From 37b135a4000ae2a83afd5d0d59022c6b868cd001 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 16 Apr 2020 16:08:37 +0200 Subject: [PATCH] Update SDS to latest version. --- src/sds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sds.c b/src/sds.c index 98bd2e77f..118971621 100644 --- a/src/sds.c +++ b/src/sds.c @@ -97,11 +97,11 @@ sds sdsnewlen(const void *init, size_t initlen) { unsigned char *fp; /* flags pointer. */ sh = s_malloc(hdrlen+initlen+1); + if (sh == NULL) return NULL; if (init==SDS_NOINIT) init = NULL; else if (!init) memset(sh, 0, hdrlen+initlen+1); - if (sh == NULL) return NULL; s = (char*)sh+hdrlen; fp = ((unsigned char*)s)-1; switch(type) {