]> git.saurik.com Git - redis.git/blobdiff - zmalloc.c
RubyRedis: now sets are returned as arrays again, and not as Set objects
[redis.git] / zmalloc.c
index 922856590e38e306a618d4b54cf7e5a22324251f..c76b2746e30c7063735c3b411205c127d44c99c7 100644 (file)
--- a/zmalloc.c
+++ b/zmalloc.c
@@ -36,6 +36,7 @@ static size_t used_memory = 0;
 void *zmalloc(size_t size) {
     void *ptr = malloc(size+sizeof(size_t));
 
+    if (!ptr) return NULL;
     *((size_t*)ptr) = size;
     used_memory += size+sizeof(size_t);
     return (char*)ptr+sizeof(size_t);