mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
fix a few leaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38557 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1f0193537c
commit
ec040f9650
3 changed files with 22 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2015-05-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSURLConnection.m: Fix leak of limit date
|
||||||
|
* Source/NSXMLParser.m: Fix leak of string
|
||||||
|
|
||||||
2015-05-26: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
|
2015-05-26: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
|
||||||
|
|
||||||
* Source/Additions/Unicode.m
|
* Source/Additions/Unicode.m
|
||||||
|
|
|
@ -334,6 +334,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
[loop runMode: NSDefaultRunLoopMode beforeDate: limit];
|
[loop runMode: NSDefaultRunLoopMode beforeDate: limit];
|
||||||
}
|
}
|
||||||
|
[limit release];
|
||||||
if (NO == [collector done])
|
if (NO == [collector done])
|
||||||
{
|
{
|
||||||
data = nil;
|
data = nil;
|
||||||
|
|
|
@ -734,7 +734,7 @@ static SEL foundIgnorableSel;
|
||||||
RELEASE(this->tagPath);
|
RELEASE(this->tagPath);
|
||||||
RELEASE(this->namespaces);
|
RELEASE(this->namespaces);
|
||||||
RELEASE(this->defaults);
|
RELEASE(this->defaults);
|
||||||
[this release];
|
RELEASE(this);
|
||||||
_parser = 0;
|
_parser = 0;
|
||||||
_handler = 0;
|
_handler = 0;
|
||||||
}
|
}
|
||||||
|
@ -782,7 +782,7 @@ static SEL foundIgnorableSel;
|
||||||
tmp = [[NSString alloc] initWithData: data encoding: enc];
|
tmp = [[NSString alloc] initWithData: data encoding: enc];
|
||||||
this->data
|
this->data
|
||||||
= [[tmp dataUsingEncoding: NSUTF8StringEncoding] retain];
|
= [[tmp dataUsingEncoding: NSUTF8StringEncoding] retain];
|
||||||
[tmp release];
|
RELEASE(tmp);
|
||||||
}
|
}
|
||||||
this->tagPath = [[NSMutableArray alloc] init];
|
this->tagPath = [[NSMutableArray alloc] init];
|
||||||
this->namespaces = [[NSMutableArray alloc] init];
|
this->namespaces = [[NSMutableArray alloc] init];
|
||||||
|
@ -1587,6 +1587,7 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
||||||
seg = NewUTF8STR(start, ptr - start);
|
seg = NewUTF8STR(start, ptr - start);
|
||||||
if (nil == seg)
|
if (nil == seg)
|
||||||
{
|
{
|
||||||
|
[m release];
|
||||||
[self _parseError: @"invalid character in quoted string"
|
[self _parseError: @"invalid character in quoted string"
|
||||||
code: NSXMLParserInvalidCharacterError];
|
code: NSXMLParserInvalidCharacterError];
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -2008,6 +2009,7 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
||||||
if (c != '>')
|
if (c != '>')
|
||||||
{
|
{
|
||||||
[attributes release];
|
[attributes release];
|
||||||
|
[tag release];
|
||||||
return [self _parseError: @"<tag/ is missing the >"
|
return [self _parseError: @"<tag/ is missing the >"
|
||||||
code: NSXMLParserGTRequiredError];
|
code: NSXMLParserGTRequiredError];
|
||||||
}
|
}
|
||||||
|
@ -2024,6 +2026,8 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
||||||
c = cget();
|
c = cget();
|
||||||
if (c != '>')
|
if (c != '>')
|
||||||
{
|
{
|
||||||
|
[attributes release];
|
||||||
|
[tag release];
|
||||||
return [self _parseError:
|
return [self _parseError:
|
||||||
@"<?tag ...? is missing the >"
|
@"<?tag ...? is missing the >"
|
||||||
code: NSXMLParserGTRequiredError];
|
code: NSXMLParserGTRequiredError];
|
||||||
|
@ -2034,6 +2038,8 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
||||||
if ([tag isEqualToString: @"?xml"]
|
if ([tag isEqualToString: @"?xml"]
|
||||||
&& sp != [this->data bytes])
|
&& sp != [this->data bytes])
|
||||||
{
|
{
|
||||||
|
[attributes release];
|
||||||
|
[tag release];
|
||||||
return [self _parseError: @"bad <?xml > preamble"
|
return [self _parseError: @"bad <?xml > preamble"
|
||||||
code: NSXMLParserDocumentStartError];
|
code: NSXMLParserDocumentStartError];
|
||||||
}
|
}
|
||||||
|
@ -2062,6 +2068,9 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
||||||
#endif
|
#endif
|
||||||
if (!this->acceptHTML && [arg length] == 0)
|
if (!this->acceptHTML && [arg length] == 0)
|
||||||
{
|
{
|
||||||
|
RELEASE(arg);
|
||||||
|
RELEASE(tag);
|
||||||
|
RELEASE(attributes);
|
||||||
return [self _parseError: @"empty attribute name"
|
return [self _parseError: @"empty attribute name"
|
||||||
code: NSXMLParserAttributeNotStartedError];
|
code: NSXMLParserAttributeNotStartedError];
|
||||||
}
|
}
|
||||||
|
@ -2082,7 +2091,7 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
||||||
}
|
}
|
||||||
val = [self _newQarg];
|
val = [self _newQarg];
|
||||||
[attributes setObject: val forKey: arg];
|
[attributes setObject: val forKey: arg];
|
||||||
[val release];
|
RELEASE(val);
|
||||||
c = cget(); // get character behind qarg value
|
c = cget(); // get character behind qarg value
|
||||||
while (isspace(c))
|
while (isspace(c))
|
||||||
{
|
{
|
||||||
|
@ -2092,11 +2101,11 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes);
|
||||||
else // implicit
|
else // implicit
|
||||||
{
|
{
|
||||||
[attributes setObject: @"" forKey: arg];
|
[attributes setObject: @"" forKey: arg];
|
||||||
}
|
}
|
||||||
[arg release];
|
RELEASE(arg);
|
||||||
}
|
}
|
||||||
[attributes release];
|
RELEASE(attributes);
|
||||||
[tag release];
|
RELEASE(tag);
|
||||||
vp = this->cp; // prepare for next value
|
vp = this->cp; // prepare for next value
|
||||||
c = cget(); // skip > and fetch next character
|
c = cget(); // skip > and fetch next character
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue