hivex: Check unchecked calloc (Jim Meyering).
[libguestfs.git] / hivex / hivex.c
index b522ccf..4fa3b30 100644 (file)
@@ -271,6 +271,8 @@ hivex_open (const char *filename, int flags)
   }
 
   h->bitmap = calloc (1 + h->size / 32, 1);
+  if (h->bitmap == NULL)
+    goto error;
 
 #if 0                           /* Doesn't work. */
   /* Header checksum. */