Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
zix-0.6.2/test/test_filesystem.c:253:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
zix-0.6.2/test/test_filesystem.c:248:21: acquire_resource: opened here
zix-0.6.2/test/test_filesystem.c:249:6: branch_true: following ‘true’ branch...
zix-0.6.2/test/test_filesystem.c:250:24: branch_true: ...to here
zix-0.6.2/test/test_filesystem.c:253:11: throw: if ‘fflush’ throws an exception...
zix-0.6.2/test/test_filesystem.c:253:11: danger: ‘fopen(path, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  251|       fwrite(contents, 1, len, f);
#  252|   
#  253|->     ret = fflush(f) ? errno : ferror(f) ? EBADF : 0;
#  254|       ret = (fclose(f) && !ret) ? errno : ret;
#  255|     }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
zix-0.6.2/test/test_filesystem.c:253:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
zix-0.6.2/test/test_filesystem.c:248:21: acquire_memory: allocated here
zix-0.6.2/test/test_filesystem.c:249:6: branch_true: following ‘true’ branch...
zix-0.6.2/test/test_filesystem.c:250:24: branch_true: ...to here
zix-0.6.2/test/test_filesystem.c:253:11: throw: if ‘fflush’ throws an exception...
zix-0.6.2/test/test_filesystem.c:253:11: danger: ‘fopen(path, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  251|       fwrite(contents, 1, len, f);
#  252|   
#  253|->     ret = fflush(f) ? errno : ferror(f) ? EBADF : 0;
#  254|       ret = (fclose(f) && !ret) ? errno : ret;
#  255|     }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
zix-0.6.2/test/test_filesystem.c:368:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "a+")’
zix-0.6.2/test/test_filesystem.c:355:1: enter_function: entry to ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: call_function: calling ‘create_temp_dir’ from ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: return_function: returning to ‘test_flock’ from ‘create_temp_dir’
zix-0.6.2/test/test_filesystem.c:359:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:362:20: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:363:20: acquire_resource: opened here
zix-0.6.2/test/test_filesystem.c:365:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:368:18: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:368:18: throw: if ‘zix_file_lock’ throws an exception...
zix-0.6.2/test/test_filesystem.c:368:18: danger: ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "a+")’ leaks here; was opened at [(14)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/13)
#  366|     assert(f2);
#  367|   
#  368|->   ZixStatus st = zix_file_lock(f1, ZIX_FILE_LOCK_TRY);
#  369|     assert(!st || st == ZIX_STATUS_NOT_SUPPORTED);
#  370|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
zix-0.6.2/test/test_filesystem.c:368:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "w")’
zix-0.6.2/test/test_filesystem.c:355:1: enter_function: entry to ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: call_function: calling ‘create_temp_dir’ from ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: return_function: returning to ‘test_flock’ from ‘create_temp_dir’
zix-0.6.2/test/test_filesystem.c:359:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:362:20: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:362:20: acquire_resource: opened here
zix-0.6.2/test/test_filesystem.c:365:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:368:18: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:368:18: throw: if ‘zix_file_lock’ throws an exception...
zix-0.6.2/test/test_filesystem.c:368:18: danger: ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "w")’ leaks here; was opened at [(14)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/13)
#  366|     assert(f2);
#  367|   
#  368|->   ZixStatus st = zix_file_lock(f1, ZIX_FILE_LOCK_TRY);
#  369|     assert(!st || st == ZIX_STATUS_NOT_SUPPORTED);
#  370|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
zix-0.6.2/test/test_filesystem.c:368:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "a+")’
zix-0.6.2/test/test_filesystem.c:355:1: enter_function: entry to ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: call_function: calling ‘create_temp_dir’ from ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: return_function: returning to ‘test_flock’ from ‘create_temp_dir’
zix-0.6.2/test/test_filesystem.c:359:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:362:20: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:363:20: acquire_memory: allocated here
zix-0.6.2/test/test_filesystem.c:365:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:368:18: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:368:18: throw: if ‘zix_file_lock’ throws an exception...
zix-0.6.2/test/test_filesystem.c:368:18: danger: ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "a+")’ leaks here; was allocated at [(14)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/13)
#  366|     assert(f2);
#  367|   
#  368|->   ZixStatus st = zix_file_lock(f1, ZIX_FILE_LOCK_TRY);
#  369|     assert(!st || st == ZIX_STATUS_NOT_SUPPORTED);
#  370|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
zix-0.6.2/test/test_filesystem.c:368:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "w")’
zix-0.6.2/test/test_filesystem.c:355:1: enter_function: entry to ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: call_function: calling ‘create_temp_dir’ from ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: return_function: returning to ‘test_flock’ from ‘create_temp_dir’
zix-0.6.2/test/test_filesystem.c:359:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:362:20: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:362:20: acquire_memory: allocated here
zix-0.6.2/test/test_filesystem.c:365:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:368:18: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:368:18: throw: if ‘zix_file_lock’ throws an exception...
zix-0.6.2/test/test_filesystem.c:368:18: danger: ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "w")’ leaks here; was allocated at [(14)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/13)
#  366|     assert(f2);
#  367|   
#  368|->   ZixStatus st = zix_file_lock(f1, ZIX_FILE_LOCK_TRY);
#  369|     assert(!st || st == ZIX_STATUS_NOT_SUPPORTED);
#  370|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
zix-0.6.2/test/test_filesystem.c:369:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "a+")’
zix-0.6.2/test/test_filesystem.c:355:1: enter_function: entry to ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: call_function: calling ‘create_temp_dir’ from ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: return_function: returning to ‘test_flock’ from ‘create_temp_dir’
zix-0.6.2/test/test_filesystem.c:359:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:362:20: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:363:20: acquire_resource: opened here
zix-0.6.2/test/test_filesystem.c:365:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:368:18: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:369:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:371:6: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:371:6: branch_true: following ‘true’ branch...
zix-0.6.2/test/test_filesystem.c:372:5: branch_true: ...to here
zix-0.6.2/test/test_filesystem.c:372:5: throw: if ‘zix_file_lock’ throws an exception...
zix-0.6.2/test/test_filesystem.c:369:3: danger: ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "a+")’ leaks here; was opened at [(14)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/13)
#  367|   
#  368|     ZixStatus st = zix_file_lock(f1, ZIX_FILE_LOCK_TRY);
#  369|->   assert(!st || st == ZIX_STATUS_NOT_SUPPORTED);
#  370|   
#  371|     if (!st) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
zix-0.6.2/test/test_filesystem.c:369:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "a+")’
zix-0.6.2/test/test_filesystem.c:355:1: enter_function: entry to ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: call_function: calling ‘create_temp_dir’ from ‘test_flock’
zix-0.6.2/test/test_filesystem.c:357:27: return_function: returning to ‘test_flock’ from ‘create_temp_dir’
zix-0.6.2/test/test_filesystem.c:359:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:360:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:362:20: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:363:20: acquire_memory: allocated here
zix-0.6.2/test/test_filesystem.c:365:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:366:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:368:18: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:369:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_filesystem.c:371:6: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:371:6: branch_true: following ‘true’ branch...
zix-0.6.2/test/test_filesystem.c:372:5: branch_true: ...to here
zix-0.6.2/test/test_filesystem.c:372:5: throw: if ‘zix_file_lock’ throws an exception...
zix-0.6.2/test/test_filesystem.c:369:3: danger: ‘fopen(zix_path_join(0, create_temp_dir("zixXXXXXX"), "zix_test_file"), "a+")’ leaks here; was allocated at [(14)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/13)
#  367|   
#  368|     ZixStatus st = zix_file_lock(f1, ZIX_FILE_LOCK_TRY);
#  369|->   assert(!st || st == ZIX_STATUS_NOT_SUPPORTED);
#  370|   
#  371|     if (!st) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
zix-0.6.2/test/test_filesystem.c:408:1: warning[-Wanalyzer-malloc-leak]: leak of ‘name_copy’
zix-0.6.2/test/test_filesystem.c:400:6: branch_true: following ‘true’ branch (when ‘new_names’ is non-NULL)...
zix-0.6.2/test/test_filesystem.c:401:36: branch_true: ...to here
zix-0.6.2/test/test_filesystem.c:401:36: acquire_memory: allocated here
zix-0.6.2/test/test_filesystem.c:402:5: branch_false: following ‘false’ branch (when ‘name_copy’ is non-NULL)...
zix-0.6.2/test/test_filesystem.c:403:5: branch_false: ...to here
zix-0.6.2/test/test_filesystem.c:408:1: danger: ‘name_copy’ leaks here; was allocated at [(4)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/3)
#  406|       file_list->names[file_list->n_names - 1] = name_copy;
#  407|     }
#  408|-> }
#  409|   
#  410|   static void

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
zix-0.6.2/test/test_hash.c:44:3: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#   42|     va_end(args);
#   43|   
#   44|->   zix_hash_free(state->hash);
#   45|     free(state->buffer);
#   46|     free(state->strings);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
zix-0.6.2/test/test_hash.c:44:3: warning[-Wanalyzer-malloc-leak]: leak of ‘state.strings’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#   42|     va_end(args);
#   43|   
#   44|->   zix_hash_free(state->hash);
#   45|     free(state->buffer);
#   46|     free(state->strings);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
zix-0.6.2/test/test_hash.c:157:20: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  155|     // Insert each string
#  156|     for (size_t i = 0; i < n_elems; ++i) {
#  157|->     ZixStatus st = zix_hash_insert(hash, strings[i]);
#  158|       ENSUREV(&state, !st, "Failed to insert `%s'\n", strings[i]);
#  159|     }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
zix-0.6.2/test/test_hash.c:157:20: warning[-Wanalyzer-malloc-leak]: leak of ‘state.strings’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  155|     // Insert each string
#  156|     for (size_t i = 0; i < n_elems; ++i) {
#  157|->     ZixStatus st = zix_hash_insert(hash, strings[i]);
#  158|       ENSUREV(&state, !st, "Failed to insert `%s'\n", strings[i]);
#  159|     }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
zix-0.6.2/test/test_hash.c:170:20: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  168|     // Attempt to insert each string again
#  169|     for (size_t i = 0; i < n_elems; ++i) {
#  170|->     ZixStatus st = zix_hash_insert(hash, strings[i]);
#  171|       ENSUREV(&state,
#  172|               st == ZIX_STATUS_EXISTS,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
zix-0.6.2/test/test_hash.c:170:20: warning[-Wanalyzer-malloc-leak]: leak of ‘state.strings’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  168|     // Attempt to insert each string again
#  169|     for (size_t i = 0; i < n_elems; ++i) {
#  170|->     ZixStatus st = zix_hash_insert(hash, strings[i]);
#  171|       ENSUREV(&state,
#  172|               st == ZIX_STATUS_EXISTS,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
zix-0.6.2/test/test_hash.c:180:38: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  178|     // Search for each string
#  179|     for (size_t i = 0; i < n_elems; ++i) {
#  180|->     const char* match = (const char*)zix_hash_find_record(hash, strings[i]);
#  181|       ENSUREV(&state, match, "Failed to find `%s'\n", strings[i]);
#  182|       ENSUREV(&state,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
zix-0.6.2/test/test_hash.c:180:38: warning[-Wanalyzer-malloc-leak]: leak of ‘state.strings’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  178|     // Search for each string
#  179|     for (size_t i = 0; i < n_elems; ++i) {
#  180|->     const char* match = (const char*)zix_hash_find_record(hash, strings[i]);
#  181|       ENSUREV(&state, match, "Failed to find `%s'\n", strings[i]);
#  182|       ENSUREV(&state,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
zix-0.6.2/test/test_hash.c:195:38: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  193|     if (not_indexed) {
#  194|       memcpy(not_indexed, not_indexed_string, strlen(not_indexed_string) + 1);
#  195|->     const char* match = (const char*)zix_hash_find_record(hash, not_indexed);
#  196|       free(not_indexed);
#  197|       ENSUREV(&state, !match, "Unexpectedly found `%s'\n", not_indexed_string);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
zix-0.6.2/test/test_hash.c:195:38: warning[-Wanalyzer-malloc-leak]: leak of ‘not_indexed’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  193|     if (not_indexed) {
#  194|       memcpy(not_indexed, not_indexed_string, strlen(not_indexed_string) + 1);
#  195|->     const char* match = (const char*)zix_hash_find_record(hash, not_indexed);
#  196|       free(not_indexed);
#  197|       ENSUREV(&state, !match, "Unexpectedly found `%s'\n", not_indexed_string);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
zix-0.6.2/test/test_hash.c:195:38: warning[-Wanalyzer-malloc-leak]: leak of ‘state.strings’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  193|     if (not_indexed) {
#  194|       memcpy(not_indexed, not_indexed_string, strlen(not_indexed_string) + 1);
#  195|->     const char* match = (const char*)zix_hash_find_record(hash, not_indexed);
#  196|       free(not_indexed);
#  197|       ENSUREV(&state, !match, "Unexpectedly found `%s'\n", not_indexed_string);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
zix-0.6.2/test/test_hash.c:206:27: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  204|       // Remove string
#  205|       const char* removed = NULL;
#  206|->     ZixStatus   st      = zix_hash_remove(hash, strings[i], &removed);
#  207|       ENSUREV(&state, !st, "Failed to remove `%s'\n", strings[i]);
#  208|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
zix-0.6.2/test/test_hash.c:206:27: warning[-Wanalyzer-malloc-leak]: leak of ‘state.strings’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  204|       // Remove string
#  205|       const char* removed = NULL;
#  206|->     ZixStatus   st      = zix_hash_remove(hash, strings[i], &removed);
#  207|       ENSUREV(&state, !st, "Failed to remove `%s'\n", strings[i]);
#  208|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
zix-0.6.2/test/test_hash.c:222:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  220|   
#  221|       // Ensure second removal fails
#  222|->     st = zix_hash_remove(hash, strings[i], &removed);
#  223|       ENSUREV(&state,
#  224|               st == ZIX_STATUS_NOT_FOUND,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
zix-0.6.2/test/test_hash.c:222:10: warning[-Wanalyzer-malloc-leak]: leak of ‘state.strings’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  220|   
#  221|       // Ensure second removal fails
#  222|->     st = zix_hash_remove(hash, strings[i], &removed);
#  223|       ENSUREV(&state,
#  224|               st == ZIX_STATUS_NOT_FOUND,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
zix-0.6.2/test/test_hash.c:229:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  227|   
#  228|       // Ensure value can no longer be found
#  229|->     assert(zix_hash_find(hash, strings[i]) == zix_hash_end(hash));
#  230|   
#  231|       // Check to ensure remaining strings are still present

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
zix-0.6.2/test/test_hash.c:229:5: warning[-Wanalyzer-malloc-leak]: leak of ‘state.strings’
zix-0.6.2/test/test_hash.c:272:1: enter_function: entry to ‘stress’
zix-0.6.2/test/test_hash.c:274:7: call_function: calling ‘stress_with’ from ‘stress’
#  227|   
#  228|       // Ensure value can no longer be found
#  229|->     assert(zix_hash_find(hash, strings[i]) == zix_hash_end(hash));
#  230|   
#  231|       // Check to ensure remaining strings are still present

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
zix-0.6.2/test/test_ring.c:151:19: warning[-Wanalyzer-malloc-leak]: leak of ‘big_buf’
zix-0.6.2/test/test_ring.c:98:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:99:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:99:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:100:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:100:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:102:24: branch_false: ...to here
zix-0.6.2/test/test_ring.c:108:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:111:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:111:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:113:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:113:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:114:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:114:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:116:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:116:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:117:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:117:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:118:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:119:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:120:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:120:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:122:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:127:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:128:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:128:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:130:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:131:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:133:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:133:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:135:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:136:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:137:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:137:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:139:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:139:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:141:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:142:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:144:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:145:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:147:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:148:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:150:26: branch_false: ...to here
zix-0.6.2/test/test_ring.c:150:26: acquire_memory: allocated here
zix-0.6.2/test/test_ring.c:151:19: throw: if ‘zix_ring_write’ throws an exception...
zix-0.6.2/test/test_ring.c:151:19: danger: ‘big_buf’ leaks here; was allocated at [(43)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/42)
#  149|   
#  150|     char* big_buf = (char*)calloc(size, 1);
#  151|->   n             = zix_ring_write(ring, big_buf, size - 1);
#  152|     assert(n == (uint32_t)size - 1);
#  153|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
zix-0.6.2/test/test_ring.c:154:7: warning[-Wanalyzer-malloc-leak]: leak of ‘big_buf’
zix-0.6.2/test/test_ring.c:98:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:99:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:99:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:100:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:100:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:102:24: branch_false: ...to here
zix-0.6.2/test/test_ring.c:108:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:111:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:111:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:113:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:113:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:114:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:114:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:116:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:116:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:117:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:117:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:118:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:119:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:120:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:120:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:122:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:127:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:128:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:128:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:130:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:131:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:133:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:133:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:135:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:136:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:137:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:137:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:139:3: branch_false: ...to here
zix-0.6.2/test/test_ring.c:139:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:141:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:142:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:144:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:145:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:147:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:148:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:150:26: branch_false: ...to here
zix-0.6.2/test/test_ring.c:150:26: acquire_memory: allocated here
zix-0.6.2/test/test_ring.c:152:3: branch_false: following ‘false’ branch...
zix-0.6.2/test/test_ring.c:154:7: branch_false: ...to here
zix-0.6.2/test/test_ring.c:154:7: throw: if ‘zix_ring_write’ throws an exception...
zix-0.6.2/test/test_ring.c:154:7: danger: ‘big_buf’ leaks here; was allocated at [(43)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/42)
#  152|     assert(n == (uint32_t)size - 1);
#  153|   
#  154|->   n = zix_ring_write(ring, big_buf, size);
#  155|     assert(n == 0);
#  156|   

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-213.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namezix-0.8.0-1.fc44
diffbase-store-results-to/tmp/tmp_7mk0ddk/zix-0.8.0-1.fc44.tar.xz
diffbase-time-created2026-01-08 22:16:11
diffbase-time-finished2026-01-08 22:17:40
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp_7mk0ddk/zix-0.8.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp_7mk0ddk/zix-0.8.0-1.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-213.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namezix-0.6.2-2.fc43
store-results-to/tmp/tmp2x637yka/zix-0.6.2-2.fc43.tar.xz
time-created2026-01-08 22:13:48
time-finished2026-01-08 22:15:46
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp2x637yka/zix-0.6.2-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp2x637yka/zix-0.6.2-2.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9