mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
ileak fix
This commit is contained in:
parent
cd2626e26b
commit
619f902e9b
2 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
2024-03-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSJSONSerialization.m: Fix leak reported by Larry Campbell
|
||||
git issue #377
|
||||
|
||||
2024-02-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSUserDefaults.m: Move posting of notification outside lock
|
||||
|
|
|
@ -211,10 +211,9 @@ updateStreamBuffer(ParserState* state)
|
|||
n = [stream read: &bytes[1] maxLength: i];
|
||||
if (n == i)
|
||||
{
|
||||
str = [[NSString alloc] initWithUTF8String: (char*)bytes];
|
||||
str = [NSString stringWithUTF8String: (char*)bytes];
|
||||
[str getCharacters: state->buffer
|
||||
range: NSMakeRange(0,1)];
|
||||
[str release];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -278,6 +277,7 @@ updateStreamBuffer(ParserState* state)
|
|||
state->source = str;
|
||||
updateStringBuffer(state);
|
||||
state->source = stream;
|
||||
RELEASE(str);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1146,11 +1146,12 @@ writeObject(id obj, NSMutableString *output, NSInteger tabs)
|
|||
obj = parseValue(&p);
|
||||
// Consume any data in the stream that we've failed to read
|
||||
updateStreamBuffer(&p);
|
||||
RELEASE(p.source);
|
||||
if (NULL != error)
|
||||
{
|
||||
*error = p.error;
|
||||
}
|
||||
return [obj autorelease];
|
||||
return AUTORELEASE(obj);
|
||||
}
|
||||
|
||||
+ (NSInteger) writeJSONObject: (id)obj
|
||||
|
|
Loading…
Reference in a new issue