mirror of
https://github.com/intel/isa-l.git
synced 2024-12-12 09:23:50 +01:00
mem_zero_detect_test: fix for issue reported by static code analysis
Signed-off-by: Tomasz Kantecki <tomasz.kantecki@intel.com>
This commit is contained in:
parent
5a00eaec33
commit
ac2ee91cdb
@ -78,14 +78,19 @@ int main(int argc, char *argv[])
|
||||
// Test to help memory checkers
|
||||
for (i = 1; i < 2345; i++) {
|
||||
uint8_t *newbuf = (uint8_t *) malloc(i);
|
||||
memset(newbuf, 0, i);
|
||||
failures = isal_zero_detect(newbuf, i);
|
||||
if (failures) {
|
||||
printf("Fail alloc test\n");
|
||||
free(newbuf);
|
||||
|
||||
if (newbuf == NULL) {
|
||||
printf("Fail alloc test - not enough memory\n");
|
||||
failures = -1;
|
||||
goto exit;
|
||||
}
|
||||
memset(newbuf, 0, i);
|
||||
failures = isal_zero_detect(newbuf, i);
|
||||
free(newbuf);
|
||||
if (failures) {
|
||||
printf("Fail alloc test\n");
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Test small buffers
|
||||
|
Loading…
Reference in New Issue
Block a user