parent
20df6505aa
commit
ca5b2a3a63
@ -1,39 +0,0 @@
|
||||
From 725a96aaa247cae90f46753ca85dadbf22a64e5f Mon Sep 17 00:00:00 2001
|
||||
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
Date: Mon, 30 Oct 2017 10:19:47 +0100
|
||||
Subject: [PATCH] build: do not assume that INSTALL is cp
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
INSTALL is supposed to be `install` in most of the cases which
|
||||
doesn't work with directories, but works perfectly with files.
|
||||
|
||||
Don't do this assumption.
|
||||
|
||||
Reported-by: Jiří Vymazal <jvymazal@redhat.com>
|
||||
References: https://bugzilla.redhat.com/show_bug.cgi?id=1506251
|
||||
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
---
|
||||
Makefile | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 781a41d..c6eb229 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -181,8 +181,9 @@ $(PKGCONFNAME): hiredis.h
|
||||
@echo Cflags: -I\$${includedir} -D_FILE_OFFSET_BITS=64 >> $@
|
||||
|
||||
install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME)
|
||||
- mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
|
||||
- $(INSTALL) hiredis.h async.h read.h sds.h adapters $(INSTALL_INCLUDE_PATH)
|
||||
+ mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL_LIBRARY_PATH)
|
||||
+ $(INSTALL) hiredis.h async.h read.h sds.h $(INSTALL_INCLUDE_PATH)
|
||||
+ $(INSTALL) adapters/*.h $(INSTALL_INCLUDE_PATH)/adapters
|
||||
$(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
|
||||
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIBNAME)
|
||||
$(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,55 +0,0 @@
|
||||
From 78cec256efa5ca4705af85edbdf137060c9a4b0a Mon Sep 17 00:00:00 2001
|
||||
From: Chris Lamb <chris@chris-lamb.co.uk>
|
||||
Date: Sun, 19 Jan 2020 11:49:13 +0000
|
||||
Subject: [PATCH] Abort if malloc() was unsuccessful. (Closes: #747)
|
||||
|
||||
---
|
||||
async.c | 2 ++
|
||||
dict.c | 7 ++++++-
|
||||
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/async.c b/async.c
|
||||
index 4f422d566..f9193dd05 100644
|
||||
--- a/async.c
|
||||
+++ b/async.c
|
||||
@@ -58,6 +58,8 @@ static unsigned int callbackHash(const void *key) {
|
||||
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 --git a/dict.c b/dict.c
|
||||
index 5b349f078..70ef57f6b 100644
|
||||
--- a/dict.c
|
||||
+++ b/dict.c
|
||||
@@ -72,6 +72,8 @@ static void _dictReset(dict *ht) {
|
||||
/* 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 @@ static int dictAdd(dict *ht, void *key, void *val) {
|
||||
|
||||
/* Allocates the memory and stores key */
|
||||
entry = malloc(sizeof(*entry));
|
||||
+ if (entry == NULL)
|
||||
+ abort();
|
||||
entry->next = ht->table[index];
|
||||
ht->table[index] = entry;
|
||||
|
||||
@@ -257,7 +261,8 @@ static dictEntry *dictFind(dict *ht, const void *key) {
|
||||
|
||||
static dictIterator *dictGetIterator(dict *ht) {
|
||||
dictIterator *iter = malloc(sizeof(*iter));
|
||||
-
|
||||
+ if (iter == NULL)
|
||||
+ abort();
|
||||
iter->ht = ht;
|
||||
iter->index = -1;
|
||||
iter->entry = NULL;
|
Loading…
Reference in new issue