Task #91070 - fixed.err

back to task #91070
download
Error: GCC_ANALYZER_WARNING (CWE-401):
jq-jq-1.7.1/src/jv_dtoa_tsd.c:44:5: warning[-Wanalyzer-malloc-leak]: leak of 'ctx'
jq-jq-1.7.1/src/jv_dtoa_tsd.c:42:6: branch_true: following 'true' branch (when 'ctx' is NULL)...
jq-jq-1.7.1/src/jv_dtoa_tsd.c:43:11: branch_true: ...to here
jq-jq-1.7.1/src/jv_dtoa_tsd.c:43:11: acquire_memory: allocated here
jq-jq-1.7.1/src/jv_dtoa_tsd.c:44:5: throw: if 'jvp_dtoa_context_init' throws an exception...
jq-jq-1.7.1/src/jv_dtoa_tsd.c:44:5: danger: 'ctx' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   42|     if (!ctx) {
#   43|       ctx = malloc(sizeof(struct dtoa_context));
#   44|->     jvp_dtoa_context_init(ctx);
#   45|       if (pthread_setspecific(dtoa_ctx_key, ctx) != 0) {
#   46|         fprintf(stderr, "error: cannot set thread specific data");