trungtoanit / gdata-objectivec-client

Automatically exported from code.google.com/p/gdata-objectivec-client
0 stars 0 forks source link

GDataXMLDocument leaks #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. GDataXMLDocument* doc = [[GDataXmlDocument alloc: initWithData:0 options:0 
error:NULL];
    (this will returns nil).
2. an GDataXMLDocument object will leak. 

What is the expected output? What do you see instead?
-(id)initWithData:options:error: should release itself when initialization is 
failed and returns nil,
but it won't release itself when NULL is passed to error: parameter.

The problem is at line 1621 in file: GDataXMLNode.m,

    if (xmlDoc_ == NULL) {
      if (error) {
       *error = [NSError errorWithDomain:@"com.google.GDataXML"
                                    code:-1 
                                userInfo:nil];
        // TODO(grobbins) use xmlSetGenericErrorFunc to capture error
        //[self release]; // <-- this line should be placed at...
      }
      [self release]; // <-- here.
      return nil;
    }

Original issue reported on code.google.com by Valentin...@gmail.com on 26 Nov 2010 at 7:15

GoogleCodeExporter commented 9 years ago
Fixed in http://code.google.com/p/gdata-objectivec-client/source/detail?r=607

Thank you for pointing this out.

Original comment by gregrobbins on 1 Dec 2010 at 6:53