diff options
author | rowanbeentje <rowan@beent.je> | 2009-12-14 01:23:29 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-12-14 01:23:29 +0000 |
commit | 5247ac10ff8d1fe91756c60dfd05605e8bc3d884 (patch) | |
tree | 5aa40a57a722c2b38d9759ff772530960d3d3d98 /Source/TableDocument.m | |
parent | 5298595375e55bb70edae0ddf17d921a299b1014 (diff) | |
download | sequelpro-5247ac10ff8d1fe91756c60dfd05605e8bc3d884.tar.gz sequelpro-5247ac10ff8d1fe91756c60dfd05605e8bc3d884.tar.bz2 sequelpro-5247ac10ff8d1fe91756c60dfd05605e8bc3d884.zip |
- Work through static analysis of the source, fixing a number of small memory leaks and fixing a couple of over-releases
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index e8ad22bf..284d1b62 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -295,6 +295,7 @@ [alert setAlertStyle:NSCriticalAlertStyle]; [alert runModal]; + if (spf) [spf release]; [self close]; return; } @@ -1703,7 +1704,7 @@ id tableSyntax = [[theResult fetchRowAsArray] objectAtIndex:colOffs]; if ([tableSyntax isKindOfClass:[NSData class]]) - tableSyntax = [[NSString alloc] initWithData:tableSyntax encoding:[mySQLConnection encoding]]; + tableSyntax = [[[NSString alloc] initWithData:tableSyntax encoding:[mySQLConnection encoding]] autorelease]; [createTableSyntaxTextField setStringValue:[NSString stringWithFormat:@"Create syntax for %@ '%@'", typeString, [self table]]]; @@ -2549,6 +2550,7 @@ [alert setAlertStyle:NSCriticalAlertStyle]; [alert runModal]; + if (spf) [spf release]; // [self close]; return NO; } @@ -3451,7 +3453,7 @@ { if(saveOperation == NSSaveOperation) { // Dummy error to avoid crashes after Canceling the Save Panel - *outError = [NSError errorWithDomain:@"SP_DOMAIN" code:1000 userInfo:nil]; + if (outError) *outError = [NSError errorWithDomain:@"SP_DOMAIN" code:1000 userInfo:nil]; [self saveConnectionSheet:nil]; return NO; } @@ -3600,7 +3602,7 @@ if ([theValue isKindOfClass:[NSData class]]) { theValue = [[NSString alloc] initWithData:theValue encoding:[mySQLConnection encoding]]; if (theValue == nil) { - [[NSString alloc] initWithData:theValue encoding:NSASCIIStringEncoding]; + theValue = [[NSString alloc] initWithData:theValue encoding:NSASCIIStringEncoding]; } if (theValue) [theValue autorelease]; |