diff options
author | Max <post@wickenrode.com> | 2015-06-30 23:10:40 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-06-30 23:10:40 +0200 |
commit | 3c49b0f2bc16777f83cf57825448b6689ed344e1 (patch) | |
tree | 3abbf089b7794a1c81a4d9e483d94957ffbb16bd /Source/SPSQLExporter.m | |
parent | 6d372fabdf53b8d511da42fca1a7a00fb4950539 (diff) | |
download | sequelpro-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 'Source/SPSQLExporter.m')
-rw-r--r-- | Source/SPSQLExporter.m | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m index 079ea8b9..f72bb72f 100644 --- a/Source/SPSQLExporter.m +++ b/Source/SPSQLExporter.m @@ -37,6 +37,7 @@ #import "RegexKitLite.h" #import <SPMySQL/SPMySQL.h> +#include <stdlib.h> @interface SPSQLExporter () @@ -293,8 +294,8 @@ NSMutableArray *rawColumnNames = [NSMutableArray arrayWithCapacity:colCount]; NSMutableArray *queryColumnDetails = [NSMutableArray arrayWithCapacity:colCount]; - useRawDataForColumnAtIndex = malloc(sizeof(BOOL) * colCount); - useRawHexDataForColumnAtIndex = malloc(sizeof(BOOL) * colCount); + useRawDataForColumnAtIndex = calloc(colCount, sizeof(BOOL)); + useRawHexDataForColumnAtIndex = calloc(colCount, sizeof(BOOL)); // Determine whether raw data can be used for each column during processing - safe numbers and hex-encoded data. for (j = 0; j < colCount; j++) |