igzip: Fix minor bug in igzip_rand_test

Stop igzip_rand_test from trying to free a null pointer.

Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
Reviewed-by: Greg Tucker <greg.b.tucker@intel.com>
This commit is contained in:
Roy Oursler 2016-06-22 14:34:49 -07:00 committed by Greg Tucker
parent af9c0c0f46
commit 39ce31de30

View File

@ -1362,9 +1362,10 @@ int create_custom_hufftables(struct isal_hufftables *hufftables_custom, int argc
fread(stream, 1, file_length, file); fread(stream, 1, file_length, file);
if (ferror(file)) { if (ferror(file)) {
printf("Error occurred when reading file"); printf("Error occurred when reading file\n");
fclose(file); fclose(file);
free(stream); free(stream);
stream = NULL;
return 1; return 1;
} }
@ -1373,7 +1374,10 @@ int create_custom_hufftables(struct isal_hufftables *hufftables_custom, int argc
isal_update_histogram(stream, file_length, &histogram); isal_update_histogram(stream, file_length, &histogram);
fclose(file); fclose(file);
free(stream); if (stream != NULL) {
free(stream);
stream = NULL;
}
argc--; argc--;
} }