From 3c49b0f2bc16777f83cf57825448b6689ed344e1 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 30 Jun 2015 23:10:40 +0200 Subject: Replace some malloc(a*b) with the safer calloc(a,b) variant --- Source/SPSQLExporter.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/SPSQLExporter.m') 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 +#include @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++) -- cgit v1.2.3