Initialize an allocated, but uninitialized memory
authorLaszlo Papp <ext-laszlo.papp@nokia.com>
Mon, 7 Mar 2011 09:32:22 +0000 (11:32 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 30 Mar 2011 17:34:58 +0000 (19:34 +0200)
lib/fuse.c

index ff2e5b3cfff657522a29d7f9df56a1cd4bbf204f..02af6771c33a313b433bc377b193fea1947793ff 100644 (file)
@@ -2314,7 +2314,7 @@ static struct fuse_context_i *fuse_get_context_internal(void)
        c = (struct fuse_context_i *) pthread_getspecific(fuse_context_key);
        if (c == NULL) {
                c = (struct fuse_context_i *)
-                       malloc(sizeof(struct fuse_context_i));
+                       calloc(1, sizeof(struct fuse_context_i));
                if (c == NULL) {
                        /* This is hard to deal with properly, so just
                           abort.  If memory is so low that the