Avoid possible leak caused by exception during property list parsing

This commit is contained in:
rfm 2024-11-15 21:33:40 +00:00
parent 75ae2da498
commit 1e5c30dc50

View file

@ -2734,8 +2734,9 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
GSBinaryPLParser *p = [GSBinaryPLParser alloc];
p = [p initWithData: data mutability: anOption];
result = [p rootObject];
RELEASE(p);
/* to avoid a leak on exception, autorelease before parse
*/
result = [AUTORELEASE(p) rootObject];
}
break;