mirror of
https://github.com/intel/isa-l.git
synced 2024-12-13 09:52:56 +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
|
// Test to help memory checkers
|
||||||
for (i = 1; i < 2345; i++) {
|
for (i = 1; i < 2345; i++) {
|
||||||
uint8_t *newbuf = (uint8_t *) malloc(i);
|
uint8_t *newbuf = (uint8_t *) malloc(i);
|
||||||
memset(newbuf, 0, i);
|
|
||||||
failures = isal_zero_detect(newbuf, i);
|
if (newbuf == NULL) {
|
||||||
if (failures) {
|
printf("Fail alloc test - not enough memory\n");
|
||||||
printf("Fail alloc test\n");
|
failures = -1;
|
||||||
free(newbuf);
|
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
memset(newbuf, 0, i);
|
||||||
|
failures = isal_zero_detect(newbuf, i);
|
||||||
free(newbuf);
|
free(newbuf);
|
||||||
|
if (failures) {
|
||||||
|
printf("Fail alloc test\n");
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test small buffers
|
// Test small buffers
|
||||||
|
Loading…
Reference in New Issue
Block a user