Error: GCC_ANALYZER_WARNING (CWE-775): [#def1] power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c: scope_hint: In function ‘ppd_utils_write’ power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:50:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "w")’ /usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here. /usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here. /usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here. /usr/include/glib-2.0/glib.h:32: included_from: Included from here. /usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here. /usr/include/glib-2.0/glib-object.h:24: included_from: Included from here. /usr/include/gudev-1.0/gudev/gudevenums.h:14: included_from: Included from here. /usr/include/gudev-1.0/gudev/gudev.h:11: included_from: Included from here. power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.h:12: included_from: Included from here. power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:12: included_from: Included from here. /usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’ /usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’ /usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’ power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:36:3: note: in expansion of macro ‘g_return_val_if_fail’ /usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’ /usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’ /usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’ power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:37:3: note: in expansion of macro ‘g_return_val_if_fail’ /usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’ /usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’ /usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’ power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:37:3: note: in expansion of macro ‘g_return_val_if_fail’ /usr/include/glib-2.0/glib.h:64: included_from: Included from here. power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:39:3: note: in expansion of macro ‘g_debug’ # 48| setbuf (sysfsfp, NULL); # 49| ret = fprintf (sysfsfp, "%s", value); # 50|-> if (ret <= 0) { # 51| g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), # 52| "Error writing '%s': %s", filename, g_strerror (errno)); Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:50:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "w")’ /usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’ /usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’ /usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’ power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:36:3: note: in expansion of macro ‘g_return_val_if_fail’ /usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’ /usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’ /usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’ power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:37:3: note: in expansion of macro ‘g_return_val_if_fail’ /usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’ /usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’ /usr/include/glib-2.0/glib/gmessages.h:664:9: note: in expansion of macro ‘G_LIKELY’ power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:37:3: note: in expansion of macro ‘g_return_val_if_fail’ power-profiles-daemon-0.20-build/power-profiles-daemon-0.20/src/ppd-utils.c:39:3: note: in expansion of macro ‘g_debug’ # 48| setbuf (sysfsfp, NULL); # 49| ret = fprintf (sysfsfp, "%s", value); # 50|-> if (ret <= 0) { # 51| g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), # 52| "Error writing '%s': %s", filename, g_strerror (errno));
analyzer-version-clang | 18.1.7 |
analyzer-version-cppcheck | 2.14.2 |
analyzer-version-gcc | 14.1.1 |
analyzer-version-gcc-analyzer | 14.1.1 |
analyzer-version-shellcheck | 0.10.0 |
diffbase-analyzer-version-clang | 18.1.7 |
diffbase-analyzer-version-cppcheck | 2.14.2 |
diffbase-analyzer-version-gcc | 14.1.1 |
diffbase-analyzer-version-gcc-analyzer | 14.1.1 |
diffbase-analyzer-version-shellcheck | 0.10.0 |
diffbase-enabled-plugins | clang, cppcheck, gcc, shellcheck |
diffbase-exit-code | 0 |
diffbase-host | ip-172-16-1-198.us-west-2.compute.internal |
diffbase-mock-config | fedora-41-x86_64 |
diffbase-project-name | power-profiles-daemon-0.21-3.fc41 |
diffbase-store-results-to | /tmp/tmphrl0xgim/power-profiles-daemon-0.21-3.fc41.tar.xz |
diffbase-time-created | 2024-07-03 17:08:33 |
diffbase-time-finished | 2024-07-03 17:09:51 |
diffbase-tool | csmock |
diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmphrl0xgim/power-profiles-daemon-0.21-3.fc41.tar.xz' '--gcc-analyze' '/tmp/tmphrl0xgim/power-profiles-daemon-0.21-3.fc41.src.rpm' |
diffbase-tool-version | csmock-3.5.3-1.el9 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-198.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | power-profiles-daemon-0.20-1.fc40 |
store-results-to | /tmp/tmpikt570mz/power-profiles-daemon-0.20-1.fc40.tar.xz |
time-created | 2024-07-03 17:06:30 |
time-finished | 2024-07-03 17:08:08 |
title | Fixed defects |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpikt570mz/power-profiles-daemon-0.20-1.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpikt570mz/power-profiles-daemon-0.20-1.fc40.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |