We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the return path in line 2694 is not free'ing the allocated objects orig_src, comp_src, decomp_src, leaking to (non-fatal) memory leaks.
void *testqzEndStreamInvalidParam(void *arg, int test_no) 2671 { 2672 int rc = -1; 2673 QzSession_T comp_sess = {0}, decomp_sess = {0}; 2674 QzStream_T comp_strm = {0}; 2675 QzSessionParams_T comp_params = {0}; 2676 uint8_t *orig_src, *comp_src, *decomp_src; 2677 size_t orig_sz, comp_sz, decomp_sz; 2678 unsigned int slice_sz = 0, done = 0; 2679 unsigned int consumed = 0, produced = 0; 2680 unsigned int input_left = 0, last = 0; 2681 2682 QzSession_T *test_sess = NULL; 2683 QzStream_T *test_strm = NULL; 2684 2685 TestArg_T *test_arg = (TestArg_T *) arg; 2686 2687 orig_sz = comp_sz = decomp_sz = test_arg->src_sz; 2688 orig_src = malloc(orig_sz); 2689 comp_src = malloc(comp_sz); Memory is allocated 2690 decomp_src = calloc(orig_sz, 1); 2691 2692 if (qzGetDefaults(&comp_params) != QZ_OK) { Assuming the condition is true Taking true branch 2693 QZ_ERROR("Err: fail to get default params.\n"); Potential leak of memory pointed to by 'comp_src' 2694 return NULL; 2695 }
The text was updated successfully, but these errors were encountered:
Thanks! We will fix this issue. Jira ticket created: https://jira.devtools.intel.com/browse/QATAPP-31728
Sorry, something went wrong.
+1 to this. our code security scanner blames the same lines:
Defect type: CPPCHECK_WARNING: QATzip-1.2.0/test/main.c:2694: error[memleak]: Memory leak: orig_src QATzip-1.2.0/test/main.c:2694: error[memleak]: Memory leak: decomp_src QATzip-1.2.0/test/main.c:2694: error[memleak]: Memory leak: comp_src QATzip-1.2.0/test/main.c:2520: error[memleak]: Memory leak: orig_src QATzip-1.2.0/test/main.c:2520: error[memleak]: Memory leak: decomp_src QATzip-1.2.0/test/main.c:2520: error[memleak]: Memory leak: comp_src
so, orig_src, comp_src and decomp_src can leak at test/main.c:2694 and test/main.c:2520:
orig_src
comp_src
decomp_src
test/main.c:2694
test/main.c:2520
void *testqzEndStreamInvalidParam(void *arg, int test_no) { ... // ALLOC HERE orig_src = malloc(orig_sz); comp_src = malloc(comp_sz); decomp_src = calloc(orig_sz, 1); if (qzGetDefaults(&comp_params) != QZ_OK) { QZ_ERROR("Err: fail to get default params.\n"); return NULL; //<-- LEAK HERE }
and
void *testqzDecompressStreamInvalidParam(void *arg, int test_no) { ... // ALLOC HERE orig_src = malloc(orig_sz); comp_src = malloc(comp_sz); decomp_src = calloc(orig_sz, 1); if (qzGetDefaults(&comp_params) != QZ_OK) { QZ_ERROR("Err: fail to get default params.\n"); return NULL; //<-- LEAK HERE }
No branches or pull requests
the return path in line 2694 is not free'ing the allocated objects orig_src, comp_src, decomp_src, leaking to (non-fatal) memory leaks.
The text was updated successfully, but these errors were encountered: