libchewing-0.10.3-2.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
libchewing-0.10.3/tests/genkeystroke.c:116:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  114|   
#  115|       /* Check if buffer is available. */
#  116|->     if (!chewing_buffer_Check(ctx)) {
#  117|           return;
#  118|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libchewing-0.10.3/tests/genkeystroke.c:116:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  114|   
#  115|       /* Check if buffer is available. */
#  116|->     if (!chewing_buffer_Check(ctx)) {
#  117|           return;
#  118|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
libchewing-0.10.3/tests/genkeystroke.c:120:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  118|       }
#  119|   
#  120|->     buf = chewing_buffer_String_static(ctx);
#  121|       buf_len = chewing_buffer_Len(ctx);
#  122|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
libchewing-0.10.3/tests/genkeystroke.c:120:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  118|       }
#  119|   
#  120|->     buf = chewing_buffer_String_static(ctx);
#  121|       buf_len = chewing_buffer_Len(ctx);
#  122|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
libchewing-0.10.3/tests/genkeystroke.c:121:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  119|   
#  120|       buf = chewing_buffer_String_static(ctx);
#  121|->     buf_len = chewing_buffer_Len(ctx);
#  122|   
#  123|       p = buf;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libchewing-0.10.3/tests/genkeystroke.c:121:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  119|   
#  120|       buf = chewing_buffer_String_static(ctx);
#  121|->     buf_len = chewing_buffer_Len(ctx);
#  122|   
#  123|       p = buf;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
libchewing-0.10.3/tests/genkeystroke.c:127:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  125|       for (i = 0; i < buf_len; i++) {
#  126|           arrPos[i] = count;
#  127|->         count += ueBytesFromChar(*p) <= 1 ? 1 : 2;
#  128|           p += ueBytesFromChar(*p);
#  129|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
libchewing-0.10.3/tests/genkeystroke.c:127:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  125|       for (i = 0; i < buf_len; i++) {
#  126|           arrPos[i] = count;
#  127|->         count += ueBytesFromChar(*p) <= 1 ? 1 : 2;
#  128|           p += ueBytesFromChar(*p);
#  129|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
libchewing-0.10.3/tests/genkeystroke.c:128:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  126|           arrPos[i] = count;
#  127|           count += ueBytesFromChar(*p) <= 1 ? 1 : 2;
#  128|->         p += ueBytesFromChar(*p);
#  129|       }
#  130|       arrPos[i] = count;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
libchewing-0.10.3/tests/genkeystroke.c:128:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:284:5: enter_function: entry to ‘main’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:352:9: call_function: calling ‘show_interval_buffer’ from ‘main’
#  126|           arrPos[i] = count;
#  127|           count += ueBytesFromChar(*p) <= 1 ? 1 : 2;
#  128|->         p += ueBytesFromChar(*p);
#  129|       }
#  130|       arrPos[i] = count;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
libchewing-0.10.3/tests/genkeystroke.c:313:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:313:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  311|       /* Initialize curses library */
#  312|       setlocale(LC_CTYPE, "");
#  313|->     initscr();
#  314|       if (has_colors() == TRUE) {
#  315|           start_color();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
libchewing-0.10.3/tests/genkeystroke.c:313:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:313:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  311|       /* Initialize curses library */
#  312|       setlocale(LC_CTYPE, "");
#  313|->     initscr();
#  314|       if (has_colors() == TRUE) {
#  315|           start_color();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
libchewing-0.10.3/tests/genkeystroke.c:313:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:313:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
#  311|       /* Initialize curses library */
#  312|       setlocale(LC_CTYPE, "");
#  313|->     initscr();
#  314|       if (has_colors() == TRUE) {
#  315|           start_color();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
libchewing-0.10.3/tests/genkeystroke.c:313:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:313:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  311|       /* Initialize curses library */
#  312|       setlocale(LC_CTYPE, "");
#  313|->     initscr();
#  314|       if (has_colors() == TRUE) {
#  315|           start_color();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def15]
libchewing-0.10.3/tests/genkeystroke.c:314:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
#  312|       setlocale(LC_CTYPE, "");
#  313|       initscr();
#  314|->     if (has_colors() == TRUE) {
#  315|           start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
libchewing-0.10.3/tests/genkeystroke.c:314:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:9: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
#  312|       setlocale(LC_CTYPE, "");
#  313|       initscr();
#  314|->     if (has_colors() == TRUE) {
#  315|           start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
libchewing-0.10.3/tests/genkeystroke.c:314:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
#  312|       setlocale(LC_CTYPE, "");
#  313|       initscr();
#  314|->     if (has_colors() == TRUE) {
#  315|           start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
libchewing-0.10.3/tests/genkeystroke.c:314:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:9: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  312|       setlocale(LC_CTYPE, "");
#  313|       initscr();
#  314|->     if (has_colors() == TRUE) {
#  315|           start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
libchewing-0.10.3/tests/genkeystroke.c:315:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:315:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
#  313|       initscr();
#  314|       if (has_colors() == TRUE) {
#  315|->         start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
libchewing-0.10.3/tests/genkeystroke.c:315:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:315:9: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  313|       initscr();
#  314|       if (has_colors() == TRUE) {
#  315|->         start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
libchewing-0.10.3/tests/genkeystroke.c:315:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:315:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4)
#  313|       initscr();
#  314|       if (has_colors() == TRUE) {
#  315|->         start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
libchewing-0.10.3/tests/genkeystroke.c:315:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:315:9: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  313|       initscr();
#  314|       if (has_colors() == TRUE) {
#  315|->         start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def23]
libchewing-0.10.3/tests/genkeystroke.c:316:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:316:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/4)
#  314|       if (has_colors() == TRUE) {
#  315|           start_color();
#  316|->         init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|           init_pair(3, COLOR_WHITE, COLOR_RED);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def24]
libchewing-0.10.3/tests/genkeystroke.c:316:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:316:9: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  314|       if (has_colors() == TRUE) {
#  315|           start_color();
#  316|->         init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|           init_pair(3, COLOR_WHITE, COLOR_RED);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
libchewing-0.10.3/tests/genkeystroke.c:316:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:316:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/4)
#  314|       if (has_colors() == TRUE) {
#  315|           start_color();
#  316|->         init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|           init_pair(3, COLOR_WHITE, COLOR_RED);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
libchewing-0.10.3/tests/genkeystroke.c:316:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:316:9: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  314|       if (has_colors() == TRUE) {
#  315|           start_color();
#  316|->         init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|           init_pair(3, COLOR_WHITE, COLOR_RED);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
libchewing-0.10.3/tests/genkeystroke.c:317:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:317:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/4)
#  315|           start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|->         init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|           init_pair(3, COLOR_WHITE, COLOR_RED);
#  319|           hasColor = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def28]
libchewing-0.10.3/tests/genkeystroke.c:317:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:317:9: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/2)
#  315|           start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|->         init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|           init_pair(3, COLOR_WHITE, COLOR_RED);
#  319|           hasColor = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
libchewing-0.10.3/tests/genkeystroke.c:317:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:317:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/4)
#  315|           start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|->         init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|           init_pair(3, COLOR_WHITE, COLOR_RED);
#  319|           hasColor = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
libchewing-0.10.3/tests/genkeystroke.c:317:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:317:9: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/2)
#  315|           start_color();
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|->         init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|           init_pair(3, COLOR_WHITE, COLOR_RED);
#  319|           hasColor = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
libchewing-0.10.3/tests/genkeystroke.c:318:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:318:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/4)
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|->         init_pair(3, COLOR_WHITE, COLOR_RED);
#  319|           hasColor = 1;
#  320|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def32]
libchewing-0.10.3/tests/genkeystroke.c:318:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:318:9: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/2)
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|->         init_pair(3, COLOR_WHITE, COLOR_RED);
#  319|           hasColor = 1;
#  320|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
libchewing-0.10.3/tests/genkeystroke.c:318:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:318:9: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/4)
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|->         init_pair(3, COLOR_WHITE, COLOR_RED);
#  319|           hasColor = 1;
#  320|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
libchewing-0.10.3/tests/genkeystroke.c:318:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:314:8: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/genkeystroke.c:315:9: branch_true: ...to here
libchewing-0.10.3/tests/genkeystroke.c:318:9: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/2)
#  316|           init_pair(1, COLOR_WHITE, COLOR_BLUE);
#  317|           init_pair(2, COLOR_RED, COLOR_YELLOW);
#  318|->         init_pair(3, COLOR_WHITE, COLOR_RED);
#  319|           hasColor = 1;
#  320|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
libchewing-0.10.3/tests/genkeystroke.c:321:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:321:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/4)
#  319|           hasColor = 1;
#  320|       }
#  321|->     cbreak();
#  322|       noecho();
#  323|       keypad(stdscr, 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
libchewing-0.10.3/tests/genkeystroke.c:321:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:321:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/2)
#  319|           hasColor = 1;
#  320|       }
#  321|->     cbreak();
#  322|       noecho();
#  323|       keypad(stdscr, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
libchewing-0.10.3/tests/genkeystroke.c:321:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:321:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/4)
#  319|           hasColor = 1;
#  320|       }
#  321|->     cbreak();
#  322|       noecho();
#  323|       keypad(stdscr, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
libchewing-0.10.3/tests/genkeystroke.c:321:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:321:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/2)
#  319|           hasColor = 1;
#  320|       }
#  321|->     cbreak();
#  322|       noecho();
#  323|       keypad(stdscr, 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def39]
libchewing-0.10.3/tests/genkeystroke.c:322:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:322:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/4)
#  320|       }
#  321|       cbreak();
#  322|->     noecho();
#  323|       keypad(stdscr, 1);
#  324|       start_color();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def40]
libchewing-0.10.3/tests/genkeystroke.c:322:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:322:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/2)
#  320|       }
#  321|       cbreak();
#  322|->     noecho();
#  323|       keypad(stdscr, 1);
#  324|       start_color();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
libchewing-0.10.3/tests/genkeystroke.c:322:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:322:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/4)
#  320|       }
#  321|       cbreak();
#  322|->     noecho();
#  323|       keypad(stdscr, 1);
#  324|       start_color();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
libchewing-0.10.3/tests/genkeystroke.c:322:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:322:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/2)
#  320|       }
#  321|       cbreak();
#  322|->     noecho();
#  323|       keypad(stdscr, 1);
#  324|       start_color();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
libchewing-0.10.3/tests/genkeystroke.c:323:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:323:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/4)
#  321|       cbreak();
#  322|       noecho();
#  323|->     keypad(stdscr, 1);
#  324|       start_color();
#  325|       clear();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
libchewing-0.10.3/tests/genkeystroke.c:323:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:323:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/2)
#  321|       cbreak();
#  322|       noecho();
#  323|->     keypad(stdscr, 1);
#  324|       start_color();
#  325|       clear();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
libchewing-0.10.3/tests/genkeystroke.c:323:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:323:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/4)
#  321|       cbreak();
#  322|       noecho();
#  323|->     keypad(stdscr, 1);
#  324|       start_color();
#  325|       clear();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
libchewing-0.10.3/tests/genkeystroke.c:323:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:323:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/2)
#  321|       cbreak();
#  322|       noecho();
#  323|->     keypad(stdscr, 1);
#  324|       start_color();
#  325|       clear();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
libchewing-0.10.3/tests/genkeystroke.c:324:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:324:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/4)
#  322|       noecho();
#  323|       keypad(stdscr, 1);
#  324|->     start_color();
#  325|       clear();
#  326|       refresh();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def48]
libchewing-0.10.3/tests/genkeystroke.c:324:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:324:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/2)
#  322|       noecho();
#  323|       keypad(stdscr, 1);
#  324|->     start_color();
#  325|       clear();
#  326|       refresh();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
libchewing-0.10.3/tests/genkeystroke.c:324:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:324:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/4)
#  322|       noecho();
#  323|       keypad(stdscr, 1);
#  324|->     start_color();
#  325|       clear();
#  326|       refresh();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
libchewing-0.10.3/tests/genkeystroke.c:324:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:324:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/2)
#  322|       noecho();
#  323|       keypad(stdscr, 1);
#  324|->     start_color();
#  325|       clear();
#  326|       refresh();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
libchewing-0.10.3/tests/genkeystroke.c:334:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:334:11: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/2)
#  332|   
#  333|       /* Request handle to ChewingContext */
#  334|->     ctx = chewing_new2(NULL, NULL, logger, log);
#  335|   
#  336|       /* Set keyboard type */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
libchewing-0.10.3/tests/genkeystroke.c:334:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:334:11: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/2)
#  332|   
#  333|       /* Request handle to ChewingContext */
#  334|->     ctx = chewing_new2(NULL, NULL, logger, log);
#  335|   
#  336|       /* Set keyboard type */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
libchewing-0.10.3/tests/genkeystroke.c:337:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:337:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was opened at [(5)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/4)
#  335|   
#  336|       /* Set keyboard type */
#  337|->     chewing_set_KBType(ctx, chewing_KBStr2Num("KB_DEFAULT"));
#  338|   
#  339|       /* Fill configuration values */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def54]
libchewing-0.10.3/tests/genkeystroke.c:337:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:337:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/2)
#  335|   
#  336|       /* Set keyboard type */
#  337|->     chewing_set_KBType(ctx, chewing_KBStr2Num("KB_DEFAULT"));
#  338|   
#  339|       /* Fill configuration values */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
libchewing-0.10.3/tests/genkeystroke.c:337:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("genkeystroke.log", "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:305:11: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:337:5: danger: ‘fopen("genkeystroke.log", "w")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/4)
#  335|   
#  336|       /* Set keyboard type */
#  337|->     chewing_set_KBType(ctx, chewing_KBStr2Num("KB_DEFAULT"));
#  338|   
#  339|       /* Fill configuration values */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libchewing-0.10.3/tests/genkeystroke.c:337:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:337:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/2)
#  335|   
#  336|       /* Set keyboard type */
#  337|->     chewing_set_KBType(ctx, chewing_KBStr2Num("KB_DEFAULT"));
#  338|   
#  339|       /* Fill configuration values */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
libchewing-0.10.3/tests/genkeystroke.c:340:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:340:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/2)
#  338|   
#  339|       /* Fill configuration values */
#  340|->     chewing_set_candPerPage(ctx, 9);
#  341|       chewing_set_maxChiSymbolLen(ctx, 16);
#  342|       chewing_set_addPhraseDirection(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
libchewing-0.10.3/tests/genkeystroke.c:340:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:340:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/2)
#  338|   
#  339|       /* Fill configuration values */
#  340|->     chewing_set_candPerPage(ctx, 9);
#  341|       chewing_set_maxChiSymbolLen(ctx, 16);
#  342|       chewing_set_addPhraseDirection(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
libchewing-0.10.3/tests/genkeystroke.c:341:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:341:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/2)
#  339|       /* Fill configuration values */
#  340|       chewing_set_candPerPage(ctx, 9);
#  341|->     chewing_set_maxChiSymbolLen(ctx, 16);
#  342|       chewing_set_addPhraseDirection(ctx, 1);
#  343|       chewing_set_selKey(ctx, selKey_define, 10);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
libchewing-0.10.3/tests/genkeystroke.c:341:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:341:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/2)
#  339|       /* Fill configuration values */
#  340|       chewing_set_candPerPage(ctx, 9);
#  341|->     chewing_set_maxChiSymbolLen(ctx, 16);
#  342|       chewing_set_addPhraseDirection(ctx, 1);
#  343|       chewing_set_selKey(ctx, selKey_define, 10);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
libchewing-0.10.3/tests/genkeystroke.c:342:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:342:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/62/codeFlows/0/threadFlows/0/locations/2)
#  340|       chewing_set_candPerPage(ctx, 9);
#  341|       chewing_set_maxChiSymbolLen(ctx, 16);
#  342|->     chewing_set_addPhraseDirection(ctx, 1);
#  343|       chewing_set_selKey(ctx, selKey_define, 10);
#  344|       chewing_set_spaceAsSelection(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
libchewing-0.10.3/tests/genkeystroke.c:342:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:342:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/2)
#  340|       chewing_set_candPerPage(ctx, 9);
#  341|       chewing_set_maxChiSymbolLen(ctx, 16);
#  342|->     chewing_set_addPhraseDirection(ctx, 1);
#  343|       chewing_set_selKey(ctx, selKey_define, 10);
#  344|       chewing_set_spaceAsSelection(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def63]
libchewing-0.10.3/tests/genkeystroke.c:343:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:343:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/2)
#  341|       chewing_set_maxChiSymbolLen(ctx, 16);
#  342|       chewing_set_addPhraseDirection(ctx, 1);
#  343|->     chewing_set_selKey(ctx, selKey_define, 10);
#  344|       chewing_set_spaceAsSelection(ctx, 1);
#  345|       chewing_set_phraseChoiceRearward(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
libchewing-0.10.3/tests/genkeystroke.c:343:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:343:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/65/codeFlows/0/threadFlows/0/locations/2)
#  341|       chewing_set_maxChiSymbolLen(ctx, 16);
#  342|       chewing_set_addPhraseDirection(ctx, 1);
#  343|->     chewing_set_selKey(ctx, selKey_define, 10);
#  344|       chewing_set_spaceAsSelection(ctx, 1);
#  345|       chewing_set_phraseChoiceRearward(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def65]
libchewing-0.10.3/tests/genkeystroke.c:344:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:344:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/2)
#  342|       chewing_set_addPhraseDirection(ctx, 1);
#  343|       chewing_set_selKey(ctx, selKey_define, 10);
#  344|->     chewing_set_spaceAsSelection(ctx, 1);
#  345|       chewing_set_phraseChoiceRearward(ctx, 1);
#  346|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
libchewing-0.10.3/tests/genkeystroke.c:344:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:344:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/2)
#  342|       chewing_set_addPhraseDirection(ctx, 1);
#  343|       chewing_set_selKey(ctx, selKey_define, 10);
#  344|->     chewing_set_spaceAsSelection(ctx, 1);
#  345|       chewing_set_phraseChoiceRearward(ctx, 1);
#  346|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def67]
libchewing-0.10.3/tests/genkeystroke.c:345:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_resource: opened here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:345:5: danger: ‘fopen(argv[1], "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/68/codeFlows/0/threadFlows/0/locations/2)
#  343|       chewing_set_selKey(ctx, selKey_define, 10);
#  344|       chewing_set_spaceAsSelection(ctx, 1);
#  345|->     chewing_set_phraseChoiceRearward(ctx, 1);
#  346|   
#  347|       clear();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
libchewing-0.10.3/tests/genkeystroke.c:345:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "w")’
libchewing-0.10.3/tests/genkeystroke.c:294:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libchewing-0.10.3/tests/genkeystroke.c:298:16: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:298:16: acquire_memory: allocated here
libchewing-0.10.3/tests/genkeystroke.c:299:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:305:11: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:306:8: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/genkeystroke.c:312:5: branch_false: ...to here
libchewing-0.10.3/tests/genkeystroke.c:345:5: danger: ‘fopen(argv[1], "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/69/codeFlows/0/threadFlows/0/locations/2)
#  343|       chewing_set_selKey(ctx, selKey_define, 10);
#  344|       chewing_set_spaceAsSelection(ctx, 1);
#  345|->     chewing_set_phraseChoiceRearward(ctx, 1);
#  346|   
#  347|       clear();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def69]
libchewing-0.10.3/tests/stress.c:105:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘input_fd’
libchewing-0.10.3/tests/stress.c:94:17: branch_true: following ‘true’ branch (when ‘i < argc’)...
libchewing-0.10.3/tests/stress.c:95:24: branch_true: ...to here
libchewing-0.10.3/tests/stress.c:95:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libchewing-0.10.3/tests/stress.c:97:18: branch_false: ...to here
libchewing-0.10.3/tests/stress.c:97:17: branch_false: following ‘false’ branch (when the strings are non-equal)...
libchewing-0.10.3/tests/stress.c:99:18: branch_false: ...to here
libchewing-0.10.3/tests/stress.c:99:17: branch_false: following ‘false’ branch (when the strings are non-equal)...
libchewing-0.10.3/tests/stress.c:102:20: branch_false: ...to here
libchewing-0.10.3/tests/stress.c:104:17: branch_false: following ‘false’ branch (when the strings are non-equal)...
libchewing-0.10.3/tests/stress.c:107:20: branch_false: ...to here
libchewing-0.10.3/tests/stress.c:107:19: branch_true: following ‘true’ branch...
libchewing-0.10.3/tests/stress.c:108:24: acquire_resource: opened here
libchewing-0.10.3/tests/stress.c:109:16: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/stress.c:114:13: branch_false: ...to here
libchewing-0.10.3/tests/stress.c:94:17: branch_true: following ‘true’ branch (when ‘i < argc’)...
libchewing-0.10.3/tests/stress.c:95:24: branch_true: ...to here
libchewing-0.10.3/tests/stress.c:95:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libchewing-0.10.3/tests/stress.c:97:18: branch_false: ...to here
libchewing-0.10.3/tests/stress.c:97:17: branch_false: following ‘false’ branch (when the strings are non-equal)...
libchewing-0.10.3/tests/stress.c:99:18: branch_false: ...to here
libchewing-0.10.3/tests/stress.c:99:17: branch_false: following ‘false’ branch (when the strings are non-equal)...
libchewing-0.10.3/tests/stress.c:102:20: branch_false: ...to here
libchewing-0.10.3/tests/stress.c:104:17: branch_true: following ‘true’ branch (when the strings are equal)...
libchewing-0.10.3/tests/stress.c:105:13: branch_true: ...to here
libchewing-0.10.3/tests/stress.c:105:13: danger: ‘input_fd’ leaks here; was opened at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  103|               flag_loop = atoi(argv[++i]);
#  104|           else if (strcmp(argv[i], "-stdin") == 0) {
#  105|->             input_fd = 0;
#  106|               get_input = &read_from_fd;
#  107|           } else if (strcmp(argv[i], "-file") == 0 && argv[i + 1]) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
libchewing-0.10.3/tests/test-bopomofo.c:2450:5: warning[-Wanalyzer-malloc-leak]: leak of ‘rt’
libchewing-0.10.3/tests/test-bopomofo.c:2449:10: acquire_memory: allocated here
libchewing-0.10.3/tests/test-bopomofo.c:2450:5: danger: ‘rt’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 2448|       ok(len == expected_len, "chewing_phone_to_bopomofo returns `%d' shall be `%d'", len, expected_len);
# 2449|       rt = calloc(sizeof(char), len);
# 2450|->     chewing_phone_to_bopomofo(expect, rt, len);
# 2451|       ok(strcmp(rt, u8phone) == 0, "PhoneFromUint d%d' shall be `%s', got `%s'", expect, u8phone, rt);
# 2452|       free(rt);

Error: CPPCHECK_WARNING (CWE-476): [#def71]
libchewing-0.10.3/tests/test-bopomofo.c:2451: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rt
# 2449|       rt = calloc(sizeof(char), len);
# 2450|       chewing_phone_to_bopomofo(expect, rt, len);
# 2451|->     ok(strcmp(rt, u8phone) == 0, "PhoneFromUint d%d' shall be `%s', got `%s'", expect, u8phone, rt);
# 2452|       free(rt);
# 2453|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
libchewing-0.10.3/tests/test-bopomofo.c:2463:5: warning[-Wanalyzer-malloc-leak]: leak of ‘rt’
libchewing-0.10.3/tests/test-bopomofo.c:2449:10: acquire_memory: allocated here
libchewing-0.10.3/tests/test-bopomofo.c:2462:10: acquire_memory: allocated here
libchewing-0.10.3/tests/test-bopomofo.c:2463:5: danger: ‘rt’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 2461|       ok(len == expected_len, "chewing_phone_to_bopomofo returns `%d' shall be `%d'", len, expected_len);
# 2462|       rt = calloc(sizeof(char), len);
# 2463|->     chewing_phone_to_bopomofo(expect, rt, len);
# 2464|       ok(strcmp(rt, u8phone) == 0, "PhoneFromUint d%d' shall be `%s', got `%s'", expect, u8phone, rt);
# 2465|       free(rt);

Error: CPPCHECK_WARNING (CWE-476): [#def73]
libchewing-0.10.3/tests/test-bopomofo.c:2464: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rt
# 2462|       rt = calloc(sizeof(char), len);
# 2463|       chewing_phone_to_bopomofo(expect, rt, len);
# 2464|->     ok(strcmp(rt, u8phone) == 0, "PhoneFromUint d%d' shall be `%s', got `%s'", expect, u8phone, rt);
# 2465|       free(rt);
# 2466|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
libchewing-0.10.3/tests/test-bopomofo.c:2476:5: warning[-Wanalyzer-malloc-leak]: leak of ‘rt’
libchewing-0.10.3/tests/test-bopomofo.c:2449:10: acquire_memory: allocated here
libchewing-0.10.3/tests/test-bopomofo.c:2462:10: acquire_memory: allocated here
libchewing-0.10.3/tests/test-bopomofo.c:2475:10: acquire_memory: allocated here
libchewing-0.10.3/tests/test-bopomofo.c:2476:5: danger: ‘rt’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 2474|       ok(len == expected_len, "chewing_phone_to_bopomofo returns `%d' shall be `%d'", len, expected_len);
# 2475|       rt = calloc(sizeof(char), len);
# 2476|->     chewing_phone_to_bopomofo(expect, rt, len);
# 2477|       ok(strcmp(rt, u8phone) == 0, "PhoneFromUint `%d' shall be `%s', got `%s'", expect, u8phone, rt);
# 2478|       free(rt);

Error: CPPCHECK_WARNING (CWE-476): [#def75]
libchewing-0.10.3/tests/test-bopomofo.c:2477: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rt
# 2475|       rt = calloc(sizeof(char), len);
# 2476|       chewing_phone_to_bopomofo(expect, rt, len);
# 2477|->     ok(strcmp(rt, u8phone) == 0, "PhoneFromUint `%d' shall be `%s', got `%s'", expect, u8phone, rt);
# 2478|       free(rt);
# 2479|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def76]
libchewing-0.10.3/tests/testchewing.c:52:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_resource: opened here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:52:11: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   50|   
#   51|       /* Request handle to ChewingContext */
#   52|->     ctx = chewing_new();
#   53|   
#   54|       /* Set keyboard type */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
libchewing-0.10.3/tests/testchewing.c:52:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_memory: allocated here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:52:11: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   50|   
#   51|       /* Request handle to ChewingContext */
#   52|->     ctx = chewing_new();
#   53|   
#   54|       /* Set keyboard type */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def78]
libchewing-0.10.3/tests/testchewing.c:55:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_resource: opened here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:55:5: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   53|   
#   54|       /* Set keyboard type */
#   55|->     chewing_set_KBType(ctx, chewing_KBStr2Num("KB_DEFAULT"));
#   56|   
#   57|       chewing_set_candPerPage(ctx, 9);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
libchewing-0.10.3/tests/testchewing.c:55:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_memory: allocated here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:55:5: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#   53|   
#   54|       /* Set keyboard type */
#   55|->     chewing_set_KBType(ctx, chewing_KBStr2Num("KB_DEFAULT"));
#   56|   
#   57|       chewing_set_candPerPage(ctx, 9);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def80]
libchewing-0.10.3/tests/testchewing.c:57:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_resource: opened here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:57:5: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#   55|       chewing_set_KBType(ctx, chewing_KBStr2Num("KB_DEFAULT"));
#   56|   
#   57|->     chewing_set_candPerPage(ctx, 9);
#   58|       chewing_set_maxChiSymbolLen(ctx, 16);
#   59|       chewing_set_addPhraseDirection(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
libchewing-0.10.3/tests/testchewing.c:57:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_memory: allocated here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:57:5: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#   55|       chewing_set_KBType(ctx, chewing_KBStr2Num("KB_DEFAULT"));
#   56|   
#   57|->     chewing_set_candPerPage(ctx, 9);
#   58|       chewing_set_maxChiSymbolLen(ctx, 16);
#   59|       chewing_set_addPhraseDirection(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def82]
libchewing-0.10.3/tests/testchewing.c:58:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_resource: opened here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:58:5: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#   56|   
#   57|       chewing_set_candPerPage(ctx, 9);
#   58|->     chewing_set_maxChiSymbolLen(ctx, 16);
#   59|       chewing_set_addPhraseDirection(ctx, 1);
#   60|       chewing_set_selKey(ctx, selKey_define, 10);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
libchewing-0.10.3/tests/testchewing.c:58:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_memory: allocated here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:58:5: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#   56|   
#   57|       chewing_set_candPerPage(ctx, 9);
#   58|->     chewing_set_maxChiSymbolLen(ctx, 16);
#   59|       chewing_set_addPhraseDirection(ctx, 1);
#   60|       chewing_set_selKey(ctx, selKey_define, 10);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def84]
libchewing-0.10.3/tests/testchewing.c:59:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_resource: opened here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:59:5: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#   57|       chewing_set_candPerPage(ctx, 9);
#   58|       chewing_set_maxChiSymbolLen(ctx, 16);
#   59|->     chewing_set_addPhraseDirection(ctx, 1);
#   60|       chewing_set_selKey(ctx, selKey_define, 10);
#   61|       chewing_set_spaceAsSelection(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
libchewing-0.10.3/tests/testchewing.c:59:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_memory: allocated here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:59:5: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#   57|       chewing_set_candPerPage(ctx, 9);
#   58|       chewing_set_maxChiSymbolLen(ctx, 16);
#   59|->     chewing_set_addPhraseDirection(ctx, 1);
#   60|       chewing_set_selKey(ctx, selKey_define, 10);
#   61|       chewing_set_spaceAsSelection(ctx, 1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def86]
libchewing-0.10.3/tests/testchewing.c:60:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_resource: opened here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:60:5: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#   58|       chewing_set_maxChiSymbolLen(ctx, 16);
#   59|       chewing_set_addPhraseDirection(ctx, 1);
#   60|->     chewing_set_selKey(ctx, selKey_define, 10);
#   61|       chewing_set_spaceAsSelection(ctx, 1);
#   62|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
libchewing-0.10.3/tests/testchewing.c:60:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_memory: allocated here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:60:5: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#   58|       chewing_set_maxChiSymbolLen(ctx, 16);
#   59|       chewing_set_addPhraseDirection(ctx, 1);
#   60|->     chewing_set_selKey(ctx, selKey_define, 10);
#   61|       chewing_set_spaceAsSelection(ctx, 1);
#   62|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def88]
libchewing-0.10.3/tests/testchewing.c:61:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_resource: opened here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:61:5: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
#   59|       chewing_set_addPhraseDirection(ctx, 1);
#   60|       chewing_set_selKey(ctx, selKey_define, 10);
#   61|->     chewing_set_spaceAsSelection(ctx, 1);
#   62|   
#   63|       while (1) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
libchewing-0.10.3/tests/testchewing.c:61:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_memory: allocated here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:61:5: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#   59|       chewing_set_addPhraseDirection(ctx, 1);
#   60|       chewing_set_selKey(ctx, selKey_define, 10);
#   61|->     chewing_set_spaceAsSelection(ctx, 1);
#   62|   
#   63|       while (1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def90]
libchewing-0.10.3/tests/testchewing.c:64:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_resource: opened here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:64:13: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#   62|   
#   63|       while (1) {
#   64|->         i = get_keystroke(get_char_from_fp, fp);
#   65|           if (i == END)
#   66|               goto end;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
libchewing-0.10.3/tests/testchewing.c:64:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libchewing-0.10.3/tests/testchewing.c:43:8: branch_true: following ‘true’ branch (when ‘argc == 2’)...
libchewing-0.10.3/tests/testchewing.c:44:14: branch_true: ...to here
libchewing-0.10.3/tests/testchewing.c:44:14: acquire_memory: allocated here
libchewing-0.10.3/tests/testchewing.c:45:12: branch_false: following ‘false’ branch...
libchewing-0.10.3/tests/testchewing.c:52:11: branch_false: ...to here
libchewing-0.10.3/tests/testchewing.c:64:13: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#   62|   
#   63|       while (1) {
#   64|->         i = get_keystroke(get_char_from_fp, fp);
#   65|           if (i == END)
#   66|               goto end;

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-32.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-gcc-latest-x86_64
project-namelibchewing-0.10.3-2.fc44
store-results-to/tmp/tmpvnutrpum/libchewing-0.10.3-2.fc44.tar.xz
time-created2025-10-28 18:55:52
time-finished2025-10-28 18:58:38
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpvnutrpum/libchewing-0.10.3-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpvnutrpum/libchewing-0.10.3-2.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9