mirror of
https://github.com/intel/isa-l.git
synced 2025-03-04 19:13:28 +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);
|
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--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user