aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-05-09 23:38:43 +0000
committerrowanbeentje <rowan@beent.je>2010-05-09 23:38:43 +0000
commit95708b53e35b7dff1ae4b7b77f672ddc5d4fe293 (patch)
tree8419ef8a6a86de5462096e43a6fae78b1035cab3 /Frameworks
parent4bd80e43ae255768c57095cfaa45f2ff6859a1bd (diff)
downloadsequelpro-95708b53e35b7dff1ae4b7b77f672ddc5d4fe293.tar.gz
sequelpro-95708b53e35b7dff1ae4b7b77f672ddc5d4fe293.tar.bz2
sequelpro-95708b53e35b7dff1ae4b7b77f672ddc5d4fe293.zip
- Check return status when capturing query error message strings - this addresses http://spbug.com/l/250
Diffstat (limited to 'Frameworks')
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
index 05d7d42a..5980d377 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
@@ -1495,7 +1495,8 @@ void performThreadedKeepAlive(void *ptr)
// Ensure no problem occurred during the result fetch
if (mysql_errno(mConnection) != 0) {
- queryErrorMessage = [[NSString alloc] initWithString:[self stringWithCString:mysql_error(mConnection)]];
+ queryErrorMessage = [self stringWithCString:mysql_error(mConnection)];
+ if (queryErrorMessage) [queryErrorMessage retain];
queryErrorId = mysql_errno(mConnection);
break;
}
@@ -1521,7 +1522,8 @@ void performThreadedKeepAlive(void *ptr)
queryErrorId = 1317;
} else {
if (queryErrorMessage) [queryErrorMessage release], queryErrorMessage = nil;
- queryErrorMessage = [[NSString alloc] initWithString:[self stringWithCString:mysql_error(mConnection)]];
+ queryErrorMessage = [self stringWithCString:mysql_error(mConnection)];
+ if (queryErrorMessage) [queryErrorMessage retain];
queryErrorId = mysql_errno(mConnection);
// If the error was a connection error, retry once