From 05bf3412fa771b920a6f81718618195094601a56 Mon Sep 17 00:00:00 2001 From: Johnny Chan Date: Thu, 19 Apr 2012 00:44:54 -0700 Subject: [PATCH 1/2] Fixed memory leak related to guuid string creation. --- OpenUDID.m | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenUDID.m b/OpenUDID.m index bba8909..1e82b18 100644 --- a/OpenUDID.m +++ b/OpenUDID.m @@ -338,6 +338,7 @@ + (NSString*) valueWithError:(NSError **)error { userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID succesfully retrieved",@"description", nil]]; } kOpenUDIDSessionCache = [openUDID retain]; + [guuid release]; return kOpenUDIDSessionCache; } From cb54e08ea40e5eeb468fc5b68fe35893e7c611a1 Mon Sep 17 00:00:00 2001 From: Johnny Chan Date: Tue, 19 Jun 2012 01:34:04 -0700 Subject: [PATCH 2/2] Added retain to appUID to ensure proper release --- OpenUDID.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenUDID.m b/OpenUDID.m index ea844c4..7bc4af5 100644 --- a/OpenUDID.m +++ b/OpenUDID.m @@ -181,7 +181,7 @@ + (NSString*) valueWithError:(NSError **)error { // The AppUID will uniquely identify this app within the pastebins // - NSString * appUID = (NSString *) [defaults objectForKey:kOpenUDIDAppUIDKey]; + NSString * appUID = (NSString *) [[defaults objectForKey:kOpenUDIDAppUIDKey] retain]; if(appUID == nil) { // generate a new uuid and store it in user defaults @@ -346,7 +346,7 @@ + (NSString*) valueWithError:(NSError **)error { userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID succesfully retrieved",@"description", nil]]; } kOpenUDIDSessionCache = [openUDID retain]; - [guuid release]; + [appUID release]; return kOpenUDIDSessionCache; }