aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPEncodingPopupAccessory.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPEncodingPopupAccessory.m')
-rw-r--r--Source/SPEncodingPopupAccessory.m3
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);