From: Bimba Shrestha Date: Fri, 3 Apr 2020 20:39:02 +0000 (-0700) Subject: returning on null check X-Git-Tag: v1.4.5^2~69^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2067%2Fhead;p=thirdparty%2Fzstd.git returning on null check --- diff --git a/contrib/diagnose_corruption/check_flipped_bits.c b/contrib/diagnose_corruption/check_flipped_bits.c index ed3db57de..cc40ab84b 100644 --- a/contrib/diagnose_corruption/check_flipped_bits.c +++ b/contrib/diagnose_corruption/check_flipped_bits.c @@ -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);