summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-04-16 16:08:37 +0200
committerantirez <antirez@gmail.com>2020-04-16 16:08:37 +0200
commit37b135a4000ae2a83afd5d0d59022c6b868cd001 (patch)
tree193a8a9db84ee001b0f9642c039d8d829827c75d /src
parentc9388ecc73c64491b0c5aef2c6a65068ddd6b2c7 (diff)
downloadredis-37b135a4000ae2a83afd5d0d59022c6b868cd001.tar.gz
Update SDS to latest version.
Diffstat (limited to 'src')
-rw-r--r--src/sds.c2
1 files changed, 1 insertions, 1 deletions
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) {