1
0
Bryan Drewery 12 жил өмнө
parent
commit
df0ac3d6f0
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      src/binary.c

+ 2 - 2
src/binary.c

@@ -297,12 +297,12 @@ bin_checksum(const char *fname, int todo)
     
     return hash;
   fatal:
-    if ((void*)map != MAP_FAILED)
+    if (map != NULL && (void*)map != MAP_FAILED)
       munmap(map, size);
     if (fd != -1)
       close(fd);
 
-    if ((void*)outmap != MAP_FAILED)
+    if (outmap != NULL && (void*)outmap != MAP_FAILED)
       munmap(outmap, size);
     delete newbin;
     werr(ERR_BINSTAT);