]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
returning on null check 2067/head
authorBimba Shrestha <bimbashrestha@fb.com>
Fri, 3 Apr 2020 20:39:02 +0000 (13:39 -0700)
committerBimba Shrestha <bimbashrestha@fb.com>
Fri, 3 Apr 2020 20:39:02 +0000 (13:39 -0700)
contrib/diagnose_corruption/check_flipped_bits.c

index ed3db57de689eb0460c1d661d650c28047ab8c50..cc40ab84beb0174f84dc1a3af45761d931fff3e6 100644 (file)
@@ -100,6 +100,8 @@ static char* readFile(const char* filename, size_t* size) {
   buf = malloc(*size);
   if (buf == NULL) {
     fprintf(stderr, "malloc failed\n");
+    fclose(f);
+    return NULL;
   }
 
   bytes_read = fread(buf, 1, *size, f);