summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {