mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-10 16:20:42 +00:00
more leak fixes
This commit is contained in:
parent
619f902e9b
commit
e8813346e5
1 changed files with 11 additions and 7 deletions
|
@ -474,15 +474,18 @@ parseString(ParserState *state)
|
|||
{
|
||||
val = [NSMutableString new];
|
||||
}
|
||||
// Consume the trailing "
|
||||
consumeChar(state);
|
||||
if (!state->mutableStrings)
|
||||
{
|
||||
if (NO == [val makeImmutable])
|
||||
{
|
||||
val = [val copy];
|
||||
NSString *str = [val copy];
|
||||
|
||||
RELEASE(val);
|
||||
return str;
|
||||
}
|
||||
}
|
||||
// Consume the trailing "
|
||||
consumeChar(state);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
@ -549,7 +552,6 @@ parseNumber(ParserState *state)
|
|||
if (number != numberBuffer)
|
||||
{
|
||||
free(number);
|
||||
number = numberBuffer;
|
||||
}
|
||||
parseError(state);
|
||||
return nil;
|
||||
|
@ -1072,7 +1074,9 @@ writeObject(id obj, NSMutableString *output, NSInteger tabs)
|
|||
{
|
||||
if (NULL != error)
|
||||
{
|
||||
NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:
|
||||
NSDictionary *userInfo;
|
||||
|
||||
userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
_(@"JSON writing error"), NSLocalizedDescriptionKey,
|
||||
nil];
|
||||
*error = [NSError errorWithDomain: NSCocoaErrorDomain
|
||||
|
|
Loading…
Reference in a new issue