summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hiredis.h2
-rw-r--r--sds.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/hiredis.h b/hiredis.h
index d2a6e90..423d5e5 100644
--- a/hiredis.h
+++ b/hiredis.h
@@ -133,7 +133,7 @@ void redisFreeSdsCommand(sds cmd);
enum redisConnectionType {
REDIS_CONN_TCP,
- REDIS_CONN_UNIX,
+ REDIS_CONN_UNIX
};
/* Context for a connection to Redis */
diff --git a/sds.c b/sds.c
index b31ccf2..923ffd8 100644
--- a/sds.c
+++ b/sds.c
@@ -89,9 +89,9 @@ 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)
memset(sh, 0, hdrlen+initlen+1);
- if (sh == NULL) return NULL;
s = (char*)sh+hdrlen;
fp = ((unsigned char*)s)-1;
switch(type) {