Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed a memory leak in -[HTTPMessage copyWithZone:].
  • Loading branch information
AlanQuatermain committed Apr 22, 2009
1 parent d119f94 commit 68541a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion HTTPMessage/HTTPMessage.m
Expand Up @@ -110,7 +110,13 @@ - (void) dealloc
- (id) copyWithZone: (NSZone *) zone
{
CFHTTPMessageRef newMessage = CFHTTPMessageCreateCopy( kCFAllocatorDefault, _internal );
return ( [[HTTPMessage allocWithZone: zone] initWithCFHTTPMessageRef: newMessage] );
if ( newMessage == NULL )
return ( nil );

HTTPMessage * result = [[HTTPMessage allocWithZone: zone] initWithCFHTTPMessageRef: newMessage];
CFRelease( newMessage );

return ( result );
}

- (id) mutableCopyWithZone: (NSZone *) zone
Expand Down

0 comments on commit 68541a3

Please sign in to comment.