Fix some leaks

This commit is contained in:
rfm 2024-06-21 15:53:55 +01:00
parent 4233f6a9d6
commit 50e1575b8d
6 changed files with 78 additions and 46 deletions

View file

@ -1498,7 +1498,8 @@ static BOOL snuggleStart(NSString *t)
* or end tag, or one of the whitespace separated words.
* What about str?
*/
data = [[NSMutableData alloc] initWithLength: l * sizeof(unichar)];
data = AUTORELEASE([[NSMutableData alloc]
initWithLength: l * sizeof(unichar)]);
ptr = buf = [data mutableBytes];
[str getCharacters: buf];
end = buf + l;
@ -2341,7 +2342,7 @@ static BOOL snuggleStart(NSString *t)
* No pre-existing file, and no blank template available ...
* Generate a standard template.
*/
str = [[NSMutableString alloc] initWithCapacity: 1024];
str = [NSMutableString stringWithCapacity: 1024];
[str appendString: @"<?xml version=\"1.0\"?>\n"];
[str appendString: @"<!DOCTYPE gsdoc PUBLIC "];