43 lines
1.3 KiB
Diff
43 lines
1.3 KiB
Diff
diff -Nur hiredis-0.13.3.orig/async.c hiredis-0.13.3/async.c
|
|
--- hiredis-0.13.3.orig/async.c 2015-09-16 18:25:02.000000000 +0800
|
|
+++ hiredis-0.13.3/async.c 2020-03-17 11:28:02.927579511 +0800
|
|
@@ -69,6 +69,8 @@
|
|
static void *callbackValDup(void *privdata, const void *src) {
|
|
((void) privdata);
|
|
redisCallback *dup = malloc(sizeof(*dup));
|
|
+ if(dup == NULL)
|
|
+ abort();
|
|
memcpy(dup,src,sizeof(*dup));
|
|
return dup;
|
|
}
|
|
diff -Nur hiredis-0.13.3.orig/dict.c hiredis-0.13.3/dict.c
|
|
--- hiredis-0.13.3.orig/dict.c 2015-09-16 18:25:02.000000000 +0800
|
|
+++ hiredis-0.13.3/dict.c 2020-03-17 11:29:44.708321131 +0800
|
|
@@ -72,6 +72,8 @@
|
|
/* Create a new hash table */
|
|
static dict *dictCreate(dictType *type, void *privDataPtr) {
|
|
dict *ht = malloc(sizeof(*ht));
|
|
+ if (ht == NULL)
|
|
+ abort();
|
|
_dictInit(ht,type,privDataPtr);
|
|
return ht;
|
|
}
|
|
@@ -143,6 +145,8 @@
|
|
|
|
/* Allocates the memory and stores key */
|
|
entry = malloc(sizeof(*entry));
|
|
+ if (entry == NULL)
|
|
+ abort();
|
|
entry->next = ht->table[index];
|
|
ht->table[index] = entry;
|
|
|
|
@@ -258,6 +262,8 @@
|
|
static dictIterator *dictGetIterator(dict *ht) {
|
|
dictIterator *iter = malloc(sizeof(*iter));
|
|
|
|
+ if(iter == NULL)
|
|
+ abort();
|
|
iter->ht = ht;
|
|
iter->index = -1;
|
|
iter->entry = NULL;
|