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/SPEncodingPopupAccessory.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/SPEncodingPopupAccessory.m')
-rw-r--r-- | Source/SPEncodingPopupAccessory.m | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/SPEncodingPopupAccessory.m b/Source/SPEncodingPopupAccessory.m index 6c0df107..6c6be255 100644 --- a/Source/SPEncodingPopupAccessory.m +++ b/Source/SPEncodingPopupAccessory.m @@ -29,6 +29,7 @@ // More info at <https://github.com/sequelpro/sequelpro> #import "SPEncodingPopupAccessory.h" +#include <stdlib.h> @implementation SPEncodingPopupAccessory @@ -92,7 +93,7 @@ static int encodingCompare(const void *firstPtr, const void *secondPtr) while (cfEncodings[num] != kCFStringEncodingInvalidId) num++; - tmp = malloc(sizeof(CFStringEncoding) * num); + tmp = calloc(num, sizeof(CFStringEncoding)); memcpy(tmp, cfEncodings, sizeof(CFStringEncoding) * num); |