Memory management issue in ODataServiceException

Oct 12, 2010 at 3:47 PM

In its initWithError:contentType:headers:statusCode: method, values assigned to member variables, not to properties. It may cause these member variables to be overreleased in future.


-(id) initWithError:(NSString *)anError contentType:(NSString *)aContentType headers:(NSDictionary *)aHeaders statusCode:(NSInteger)aStatusCode
	if(self=[super initWithName:@"ODataServiceException" reason:anError userInfo:nil])
		m_headers=[[NSDictionary alloc]initWithDictionary:aHeaders];
	return self;

Values should be assigned to properties, e.g. self.m_error=anError etc.

Oct 13, 2010 at 7:55 PM

Thanks for reporting the issue.

I'm working on a new release of the library so I'll make sure this problem is fixed.



Mar 12, 2011 at 12:44 AM

This is fixed in Version 1.2.

Direct assignment (i.e., m_error=anError;) doesn't call the setter. We modified the code as follows.


The following are equivalent, and we used both of them interchangeably in the current code:

2)[self setError:anError];