aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/SPMySQLFramework
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-06-30 23:10:40 +0200
committerMax <post@wickenrode.com>2015-06-30 23:10:40 +0200
commit3c49b0f2bc16777f83cf57825448b6689ed344e1 (patch)
tree3abbf089b7794a1c81a4d9e483d94957ffbb16bd /Frameworks/SPMySQLFramework
parent6d372fabdf53b8d511da42fca1a7a00fb4950539 (diff)
downloadsequelpro-3c49b0f2bc16777f83cf57825448b6689ed344e1.tar.gz
sequelpro-3c49b0f2bc16777f83cf57825448b6689ed344e1.tar.bz2
sequelpro-3c49b0f2bc16777f83cf57825448b6689ed344e1.zip
Replace some malloc(a*b) with the safer calloc(a,b) variant
Diffstat (limited to 'Frameworks/SPMySQLFramework')
-rw-r--r--Frameworks/SPMySQLFramework/Source/SPMySQLFastStreamingResult.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLFastStreamingResult.m b/Frameworks/SPMySQLFramework/Source/SPMySQLFastStreamingResult.m
index 705b3daf..930180da 100644
--- a/Frameworks/SPMySQLFramework/Source/SPMySQLFastStreamingResult.m
+++ b/Frameworks/SPMySQLFramework/Source/SPMySQLFastStreamingResult.m
@@ -32,6 +32,7 @@
#import "SPMySQL Private APIs.h"
#import "SPMySQLArrayAdditions.h"
#include <pthread.h>
+#include <stdlib.h>
static id NSNullPointer;
@@ -360,7 +361,7 @@ typedef struct st_spmysqlstreamingrowdata {
newRowStore->nextRow = NULL;
// Set up the row data store - a char* - and copy in the data if there is any.
- newRowStore->data = malloc(sizeOfChar * rowDataLength);
+ newRowStore->data = calloc(rowDataLength, sizeOfChar);
for (i = 0; i < numberOfFields; i++) {
if (theRow[i] != NULL) {
memcpy(newRowStore->data+dataCopiedLength, theRow[i], fieldLengths[i]);