mirror of
https://github.com/intel/isa-l.git
synced 2024-12-13 09:52:56 +01:00
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:
parent
af9c0c0f46
commit
39ce31de30
@ -1362,9 +1362,10 @@ int create_custom_hufftables(struct isal_hufftables *hufftables_custom, int argc
|
||||
fread(stream, 1, file_length, file);
|
||||
|
||||
if (ferror(file)) {
|
||||
printf("Error occurred when reading file");
|
||||
printf("Error occurred when reading file\n");
|
||||
fclose(file);
|
||||
free(stream);
|
||||
stream = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1373,7 +1374,10 @@ int create_custom_hufftables(struct isal_hufftables *hufftables_custom, int argc
|
||||
isal_update_histogram(stream, file_length, &histogram);
|
||||
|
||||
fclose(file);
|
||||
free(stream);
|
||||
if (stream != NULL) {
|
||||
free(stream);
|
||||
stream = NULL;
|
||||
}
|
||||
argc--;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user