Author: rfm
Date: Tue May 26 15:12:41 2015
New Revision: 38557
URL: http://svn.gna.org/viewcvs/gnustep?rev=38557&view=rev
Log:
fix a few leaks
Modified:
libs/base/trunk/ChangeLog
libs/base/trunk/Source/NSURLConnection.m
libs/base/trunk/Source/NSXMLParser.m
Modified: libs/base/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=38557&r1=38556&r2=38557&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog (original)
+++ libs/base/trunk/ChangeLog Tue May 26 15:12:41 2015
@@ -1,3 +1,8 @@
+2015-05-26 Richard Frith-Macdonald <[email protected]>
+
+ * Source/NSURLConnection.m: Fix leak of limit date
+ * Source/NSXMLParser.m: Fix leak of string
+
2015-05-26: Sebastian Reitenbach <[email protected]>
* Source/Additions/Unicode.m
Modified: libs/base/trunk/Source/NSURLConnection.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSURLConnection.m?rev=38557&r1=38556&r2=38557&view=diff
==============================================================================
--- libs/base/trunk/Source/NSURLConnection.m (original)
+++ libs/base/trunk/Source/NSURLConnection.m Tue May 26 15:12:41 2015
@@ -334,6 +334,7 @@
{
[loop runMode: NSDefaultRunLoopMode beforeDate: limit];
}
+ [limit release];
if (NO == [collector done])
{
data = nil;
Modified: libs/base/trunk/Source/NSXMLParser.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSXMLParser.m?rev=38557&r1=38556&r2=38557&view=diff
==============================================================================
--- libs/base/trunk/Source/NSXMLParser.m (original)
+++ libs/base/trunk/Source/NSXMLParser.m Tue May 26 15:12:41 2015
@@ -734,7 +734,7 @@
RELEASE(this->tagPath);
RELEASE(this->namespaces);
RELEASE(this->defaults);
- [this release];
+ RELEASE(this);
_parser = 0;
_handler = 0;
}
@@ -782,7 +782,7 @@
tmp = [[NSString alloc] initWithData: data encoding: enc];
this->data
= [[tmp dataUsingEncoding: NSUTF8StringEncoding] retain];
- [tmp release];
+ RELEASE(tmp);
}
this->tagPath = [[NSMutableArray alloc] init];
this->namespaces = [[NSMutableArray alloc] init];
@@ -1587,6 +1587,7 @@
seg = NewUTF8STR(start, ptr - start);
if (nil == seg)
{
+ [m release];
[self _parseError: @"invalid character in quoted string"
code: NSXMLParserInvalidCharacterError];
return nil;
@@ -2008,6 +2009,7 @@
if (c != '>')
{
[attributes release];
+ [tag release];
return [self _parseError: @"<tag/ is missing the >"
code: NSXMLParserGTRequiredError];
}
@@ -2024,6 +2026,8 @@
c = cget();
if (c != '>')
{
+ [attributes release];
+ [tag release];
return [self _parseError:
@"<?tag ...? is missing the >"
code: NSXMLParserGTRequiredError];
@@ -2034,6 +2038,8 @@
if ([tag isEqualToString: @"?xml"]
&& sp != [this->data bytes])
{
+ [attributes release];
+ [tag release];
return [self _parseError: @"bad <?xml > preamble"
code: NSXMLParserDocumentStartError];
}
@@ -2062,6 +2068,9 @@
#endif
if (!this->acceptHTML && [arg length] == 0)
{
+ RELEASE(arg);
+ RELEASE(tag);
+ RELEASE(attributes);
return [self _parseError: @"empty attribute name"
code: NSXMLParserAttributeNotStartedError];
}
@@ -2082,7 +2091,7 @@
}
val = [self _newQarg];
[attributes setObject: val forKey: arg];
- [val release];
+ RELEASE(val);
c = cget(); // get character behind qarg value
while (isspace(c))
{
@@ -2092,11 +2101,11 @@
else // implicit
{
[attributes setObject: @"" forKey: arg];
- }
- [arg release];
- }
- [attributes release];
- [tag release];
+ }
+ RELEASE(arg);
+ }
+ RELEASE(attributes);
+ RELEASE(tag);
vp = this->cp; // prepare for next value
c = cget(); // skip > and fetch next character
}
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs