aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableSource.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-03-13 20:41:36 +0000
committerrowanbeentje <rowan@beent.je>2010-03-13 20:41:36 +0000
commitda87ee2564f73d7f578ffb08e5d03073ce49d694 (patch)
tree6b5a2e11798787e8614779c47611e506daff25b7 /Source/TableSource.m
parent4b13d761590d65d2b294aaa6c17654edbd0a811e (diff)
downloadsequelpro-da87ee2564f73d7f578ffb08e5d03073ce49d694.tar.gz
sequelpro-da87ee2564f73d7f578ffb08e5d03073ce49d694.tar.bz2
sequelpro-da87ee2564f73d7f578ffb08e5d03073ce49d694.zip
- Fix some leaks and autoreleases after checking static analysis
Diffstat (limited to 'Source/TableSource.m')
-rw-r--r--Source/TableSource.m14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/TableSource.m b/Source/TableSource.m
index e6d2d170..4694d14c 100644
--- a/Source/TableSource.m
+++ b/Source/TableSource.m
@@ -1128,6 +1128,7 @@ returns a dictionary containing enum/set field names as key and possible values
NSMutableArray *tempResult2 = [NSMutableArray array];
NSString *nullValue = [prefs stringForKey:SPNullValue];
+ CFStringRef escapedNullValue = CFXMLCreateStringByEscapingEntities(NULL, ((CFStringRef)nullValue), NULL);
MCPResult *structureQueryResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW COLUMNS FROM %@", [selectedTable backtickQuotedString]]];
MCPResult *indexesQueryResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW INDEXES FROM %@", [selectedTable backtickQuotedString]]];
@@ -1156,9 +1157,7 @@ returns a dictionary containing enum/set field names as key and possible values
for (j = 0; j < [row count]; j++)
{
if ([[row objectAtIndex:j] isNSNull]) {
-
- // Replace the NULL instance with an escaped version of the user's placeholder
- [row replaceObjectAtIndex:j withObject:(NSString *)CFXMLCreateStringByEscapingEntities(NULL, ((CFStringRef)nullValue), NULL)];
+ [row replaceObjectAtIndex:j withObject:(NSString *)escapedNullValue];
}
}
@@ -1166,7 +1165,7 @@ returns a dictionary containing enum/set field names as key and possible values
[row release];
}
-
+
for (i = 0; i < [indexesQueryResult numOfRows]; i++) {
NSMutableArray *index = [[indexesQueryResult fetchRowAsArray] mutableCopy];
@@ -1177,9 +1176,7 @@ returns a dictionary containing enum/set field names as key and possible values
for (j = 0; j < [index count]; j++)
{
if ([[index objectAtIndex:j] isNSNull]) {
-
- // Replace the NULL instance with an escaped version of the user's placeholder
- [index replaceObjectAtIndex:j withObject:(NSString *)CFXMLCreateStringByEscapingEntities(NULL, ((CFStringRef)nullValue), NULL)];
+ [index replaceObjectAtIndex:j withObject:(NSString *)escapedNullValue];
}
}
@@ -1187,7 +1184,8 @@ returns a dictionary containing enum/set field names as key and possible values
[index release];
}
-
+
+ CFRelease(escapedNullValue);
return [NSDictionary dictionaryWithObjectsAndKeys:tempResult, @"structure", tempResult2, @"indexes", nil];
}