Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1]
SDL3-3.2.20/src/test/SDL_test_log.c:88:11: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
SDL3-3.2.20/src/test/SDL_test_log.c:87:5: acquire_resource: ‘va_start’ called here
SDL3-3.2.20/src/test/SDL_test_log.c:88:11: throw: if ‘SDL_vsnprintf’ throws an exception...
SDL3-3.2.20/src/test/SDL_test_log.c:88:11: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   86|       SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
#   87|       va_start(list, fmt);
#   88|->     (void)SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list);
#   89|       va_end(list);
#   90|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def2]
SDL3-3.2.20/src/test/SDL_test_log.c:106:11: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
SDL3-3.2.20/src/test/SDL_test_log.c:105:5: acquire_resource: ‘va_start’ called here
SDL3-3.2.20/src/test/SDL_test_log.c:106:11: throw: if ‘SDL_vsnprintf’ throws an exception...
SDL3-3.2.20/src/test/SDL_test_log.c:106:11: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  104|       SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
#  105|       va_start(list, fmt);
#  106|->     (void)SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list);
#  107|       va_end(list);
#  108|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:376:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:363:8: branch_false: following ‘false’ branch (when ‘offer’ is non-NULL)...
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:367:5: branch_false: ...to here
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:368:8: branch_false: following ‘false’ branch (when ‘data_device’ is non-NULL)...
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:370:16: branch_false: ...to here
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:370:15: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:373:56: branch_false: ...to here
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:376:9: throw: if the called function throws an exception...
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:376:9: danger: ‘pipefd[0]’ leaks here
#  374|   
#  375|           // TODO: Needs pump and flush?
#  376|->         WAYLAND_wl_display_flush(data_device->video_data->display);
#  377|   
#  378|           close(pipefd[1]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:412:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:399:8: branch_false: following ‘false’ branch (when ‘offer’ is non-NULL)...
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:403:5: branch_false: ...to here
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:404:8: branch_false: following ‘false’ branch (when ‘primary_selection_device’ is non-NULL)...
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:406:16: branch_false: ...to here
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:406:15: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:409:73: branch_false: ...to here
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:412:9: throw: if the called function throws an exception...
SDL3-3.2.20/src/video/wayland/SDL_waylanddatamanager.c:412:9: danger: ‘pipefd[0]’ leaks here
#  410|   
#  411|           // TODO: Needs pump and flush?
#  412|->         WAYLAND_wl_display_flush(primary_selection_device->video_data->display);
#  413|   
#  414|           close(pipefd[1]);

Error: CPPCHECK_WARNING (CWE-457): [#def5]
SDL3-3.2.20/src/video/wayland/SDL_waylandevents.c:156: error[uninitvar]: Uninitialized variable: tp->surface
#  154|   
#  155|       wl_list_for_each (tp, &touch_points, link) {
#  156|->         if (tp->surface == surface) {
#  157|               return true;
#  158|           }

Error: CPPCHECK_WARNING (CWE-457): [#def6]
SDL3-3.2.20/src/video/wayland/SDL_waylandevents.c:1220: error[uninitvar]: Uninitialized variable: tp->surface
# 1218|           bool removed = false;
# 1219|   
# 1220|->         if (tp->surface) {
# 1221|               SDL_WindowData *window_data = (SDL_WindowData *)wl_surface_get_user_data(tp->surface);
# 1222|   

Error: CPPCHECK_WARNING (CWE-457): [#def7]
SDL3-3.2.20/src/video/wayland/SDL_waylandevents.c:3204: error[uninitvar]: Uninitialized variables: tp.id, tp.fx, tp.fy, tp.surface, tp.link
# 3202|           wl_list_for_each_safe (tp, tmp, &touch_points, link) {
# 3203|               WAYLAND_wl_list_remove(&tp->link);
# 3204|->             SDL_free(tp);
# 3205|           }
# 3206|       }

Error: CPPCHECK_WARNING (CWE-457): [#def8]
SDL3-3.2.20/src/video/wayland/SDL_waylandmouse.c:618: error[uninitvar]: Uninitialized variables: c.scale, c.node
#  616|           wl_list_for_each_safe(c, temp, &d->cursor_data.custom.scaled_cursor_cache, node) {
#  617|               Wayland_ReleaseSHMBuffer(&c->shmBuffer);
#  618|->             SDL_free(c);
#  619|           }
#  620|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:201:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:854:6: enter_function: entry to ‘X11_ShowMessageBox’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_true: following ‘true’ branch (when ‘pid == 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: branch_true: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:875:18: call_function: calling ‘X11_ShowMessageBoxImpl’ from ‘X11_ShowMessageBox’
#  199|       data->pbuttonid = pbuttonid;
#  200|   
#  201|->     data->display = X11_XOpenDisplay(NULL);
#  202|       if (!data->display) {
#  203|           return SDL_SetError("Couldn't open X11 display");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:227:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:854:6: enter_function: entry to ‘X11_ShowMessageBox’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_true: following ‘true’ branch (when ‘pid == 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: branch_true: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:875:18: call_function: calling ‘X11_ShowMessageBoxImpl’ from ‘X11_ShowMessageBox’
#  225|   #endif
#  226|       {
#  227|->         data->font_struct = X11_XLoadQueryFont(data->display, g_MessageBoxFontLatin1);
#  228|           if (!data->font_struct) {
#  229|               return SDL_SetError("Couldn't load font %s", g_MessageBoxFontLatin1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:813:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:854:6: enter_function: entry to ‘X11_ShowMessageBox’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_true: following ‘true’ branch (when ‘pid == 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: branch_true: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:875:18: call_function: calling ‘X11_ShowMessageBoxImpl’ from ‘X11_ShowMessageBox’
#  811|       SDL_zero(data);
#  812|   
#  813|->     if (!SDL_X11_LoadSymbols()) {
#  814|           return false;
#  815|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:829:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:854:6: enter_function: entry to ‘X11_ShowMessageBox’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_true: following ‘true’ branch (when ‘pid == 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: branch_true: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:875:18: call_function: calling ‘X11_ShowMessageBoxImpl’ from ‘X11_ShowMessageBox’
#  827|   
#  828|       // This code could get called from multiple threads maybe?
#  829|->     X11_XInitThreads();
#  830|   
#  831|       // Initialize the return buttonID value to -1 (for error or dialogbox closed).

Error: GCC_ANALYZER_WARNING (CWE-775): [#def13]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:869:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_true: following ‘true’ branch (when ‘pid == -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:869:9: branch_true: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:869:9: throw: if ‘close’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:869:9: danger: ‘fds[0]’ leaks here
#  867|       pid = fork();
#  868|       if (pid == -1) { // failed
#  869|->         close(fds[0]);
#  870|           close(fds[1]);
#  871|           return X11_ShowMessageBoxImpl(messageboxdata, buttonID); // oh well.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:869:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_true: following ‘true’ branch (when ‘pid == -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:869:9: branch_true: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:869:9: throw: if ‘close’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:869:9: danger: ‘fds[1]’ leaks here
#  867|       pid = fork();
#  868|       if (pid == -1) { // failed
#  869|->         close(fds[0]);
#  870|           close(fds[1]);
#  871|           return X11_ShowMessageBoxImpl(messageboxdata, buttonID); // oh well.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def15]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:870:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_true: following ‘true’ branch (when ‘pid == -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:869:9: branch_true: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:870:9: throw: if ‘close’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:870:9: danger: ‘fds[1]’ leaks here
#  868|       if (pid == -1) { // failed
#  869|           close(fds[0]);
#  870|->         close(fds[1]);
#  871|           return X11_ShowMessageBoxImpl(messageboxdata, buttonID); // oh well.
#  872|       } else if (pid == 0) {                                       // we're the child

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_true: following ‘true’ branch (when ‘pid == 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: branch_true: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: throw: if ‘close’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: danger: ‘fds[0]’ leaks here
#  872|       } else if (pid == 0) {                                       // we're the child
#  873|           int exitcode = 0;
#  874|->         close(fds[0]);
#  875|           result = X11_ShowMessageBoxImpl(messageboxdata, buttonID);
#  876|           if (write(fds[1], &result, sizeof(result)) != sizeof(result)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_true: following ‘true’ branch (when ‘pid == 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: branch_true: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: throw: if ‘close’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:874:9: danger: ‘fds[1]’ leaks here
#  872|       } else if (pid == 0) {                                       // we're the child
#  873|           int exitcode = 0;
#  874|->         close(fds[0]);
#  875|           result = X11_ShowMessageBoxImpl(messageboxdata, buttonID);
#  876|           if (write(fds[1], &result, sizeof(result)) != sizeof(result)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: following ‘false’ branch (when ‘pid != 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: throw: if ‘close’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: danger: ‘fds[1]’ leaks here
#  883|       } else {             // we're the parent
#  884|           pid_t rc;
#  885|->         close(fds[1]);
#  886|           do {
#  887|               rc = waitpid(pid, &status, 0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[status]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: following ‘false’ branch (when ‘pid != 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: throw: if ‘close’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: danger: ‘fds[status]’ leaks here
#  883|       } else {             // we're the parent
#  884|           pid_t rc;
#  885|->         close(fds[1]);
#  886|           do {
#  887|               rc = waitpid(pid, &status, 0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:887:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: following ‘false’ branch (when ‘pid != 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:888:18: branch_true: following ‘true’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:887:18: throw: if ‘waitpid’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:887:18: danger: ‘fds[0]’ leaks here
#  885|           close(fds[1]);
#  886|           do {
#  887|->             rc = waitpid(pid, &status, 0);
#  888|           } while ((rc == -1) && (errno == EINTR));
#  889|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:887:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[status]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: following ‘false’ branch (when ‘pid != 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:887:18: throw: if ‘waitpid’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:887:18: danger: ‘fds[status]’ leaks here
#  885|           close(fds[1]);
#  886|           do {
#  887|->             rc = waitpid(pid, &status, 0);
#  888|           } while ((rc == -1) && (errno == EINTR));
#  889|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:899:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:863:8: branch_false: following ‘false’ branch...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:867:11: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:868:8: branch_false: following ‘false’ branch (when ‘pid != -1’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:872:15: branch_false: following ‘false’ branch (when ‘pid != 0’)...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:885:9: branch_false: ...to here
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:899:9: throw: if ‘close’ throws an exception...
SDL3-3.2.20/src/video/x11/SDL_x11messagebox.c:899:9: danger: ‘fds[0]’ leaks here
#  897|               *buttonID = 0;
#  898|           }
#  899|->         close(fds[0]);
#  900|   
#  901|           return result;

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-167.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-nameSDL3-3.4.0-1.fc44
diffbase-store-results-to/tmp/tmp0v8lh_tj/SDL3-3.4.0-1.fc44.tar.xz
diffbase-time-created2026-01-08 15:26:57
diffbase-time-finished2026-01-08 15:36:58
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp0v8lh_tj/SDL3-3.4.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp0v8lh_tj/SDL3-3.4.0-1.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-167.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameSDL3-3.2.20-1.fc43
store-results-to/tmp/tmpaqptmgsc/SDL3-3.2.20-1.fc43.tar.xz
time-created2026-01-08 15:17:42
time-finished2026-01-08 15:26:34
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpaqptmgsc/SDL3-3.2.20-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpaqptmgsc/SDL3-3.2.20-1.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9