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];
|
val = [NSMutableString new];
|
||||||
}
|
}
|
||||||
|
// Consume the trailing "
|
||||||
|
consumeChar(state);
|
||||||
if (!state->mutableStrings)
|
if (!state->mutableStrings)
|
||||||
{
|
{
|
||||||
if (NO == [val makeImmutable])
|
if (NO == [val makeImmutable])
|
||||||
{
|
{
|
||||||
val = [val copy];
|
NSString *str = [val copy];
|
||||||
|
|
||||||
|
RELEASE(val);
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Consume the trailing "
|
|
||||||
consumeChar(state);
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,10 +552,9 @@ parseNumber(ParserState *state)
|
||||||
if (number != numberBuffer)
|
if (number != numberBuffer)
|
||||||
{
|
{
|
||||||
free(number);
|
free(number);
|
||||||
number = numberBuffer;
|
|
||||||
}
|
}
|
||||||
parseError(state);
|
parseError(state);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
BUFFER(c);
|
BUFFER(c);
|
||||||
while (isdigit(c = consumeChar(state)))
|
while (isdigit(c = consumeChar(state)))
|
||||||
|
@ -1072,7 +1074,9 @@ writeObject(id obj, NSMutableString *output, NSInteger tabs)
|
||||||
{
|
{
|
||||||
if (NULL != error)
|
if (NULL != error)
|
||||||
{
|
{
|
||||||
NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:
|
NSDictionary *userInfo;
|
||||||
|
|
||||||
|
userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
_(@"JSON writing error"), NSLocalizedDescriptionKey,
|
_(@"JSON writing error"), NSLocalizedDescriptionKey,
|
||||||
nil];
|
nil];
|
||||||
*error = [NSError errorWithDomain: NSCocoaErrorDomain
|
*error = [NSError errorWithDomain: NSCocoaErrorDomain
|
||||||
|
|
Loading…
Reference in a new issue