Task #377 - fixed.err

back to task #377
download
Error: CLANG_WARNING:
dracut-059-build/dracut-059/src/install/dracut-install.c:638:25: warning[unix.Malloc]: Potential leak of memory pointed to by 'dstpath'
#  636|   
#  637|           if (!(srcpath && dstpath))
#  638|->                 return -ENOMEM;
#  639|   
#  640|           size_t dlen = dir_len(src);

Error: CLANG_WARNING:
dracut-059-build/dracut-059/src/install/dracut-install.c:638:25: warning[unix.Malloc]: Potential leak of memory pointed to by 'srcpath'
#  636|   
#  637|           if (!(srcpath && dstpath))
#  638|->                 return -ENOMEM;
#  639|   
#  640|           size_t dlen = dir_len(src);

Error: GCC_ANALYZER_WARNING (CWE-688):
dracut-059-build/dracut-059/src/install/dracut-install.c: scope_hint: In function ‘parse_argv’
dracut-059-build/dracut-059/src/install/dracut-install.c:1089:41: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘sysrootdir’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 1087|                   case 'r':
# 1088|                           sysrootdir = strdup(optarg);
# 1089|->                         sysrootdirlen = strlen(sysrootdir);
# 1090|                           break;
# 1091|                   case 'p':

Error: CLANG_WARNING:
dracut-059-build/dracut-059/src/install/dracut-install.c:1340:37: warning[unix.Malloc]: Potential leak of memory pointed to by 'dest'
# 1338|                           if (strchr(argv[i], '*') == NULL) {
# 1339|                                   _cleanup_free_ char *dest = strdup(argv[i]);
# 1340|->                                 ret = dracut_install(argv[i], dest, arg_createdir, arg_resolvedeps, true);
# 1341|                           } else {
# 1342|                                   _cleanup_free_ char *realsrc = NULL;

Error: GCC_ANALYZER_WARNING (CWE-688):
dracut-059-build/dracut-059/src/install/dracut-install.c: scope_hint: In function ‘main’
dracut-059-build/dracut-059/src/install/dracut-install.c:2033:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘destrootdir’ where non-null expected
dracut-059-build/dracut-059/src/install/dracut-install.c:47: included_from: Included from here.
dracut-059-build/dracut-059/src/install/dracut-install.c:1996:9: note: in expansion of macro ‘log_debug’
dracut-059-build/dracut-059/src/install/dracut-install.c:36: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
# 2031|           }
# 2032|   
# 2033|->         if (strcmp(destrootdir, "/") == 0) {
# 2034|                   log_error("Environment DESTROOTDIR or argument -D is set to '/'!");
# 2035|                   usage(EXIT_FAILURE);

Error: COMPILER_WARNING (CWE-457):
dracut-059-build/dracut-059/src/install/util.h:535:9: warning[-Wmaybe-uninitialized]: ‘dst’ may be used uninitialized
#  535 |         free(*(void **)p);
#      |         ^~~~~~~~~~~~~~~~~
dracut-059-build/dracut-059/src/install/dracut-install.c: scope_hint: In function ‘dracut_install’
dracut-059-build/dracut-059/src/install/dracut-install.c:756:30: note: ‘dst’ was declared here
#  756 |         _cleanup_free_ char *dst;
#      |                              ^~~
#  533|   static inline void freep(void *p)
#  534|   {
#  535|->         free(*(void **)p);
#  536|   }
#  537|   

Error: CLANG_WARNING:
dracut-059-build/dracut-059/src/util/util.c:276:37: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  274|                   if (strcmp(key, search_key) == 0) {
#  275|                           if (search_value) {
#  276|->                                 if (strcmp(value, search_value) == 0) {
#  277|                                           printf("%s\n", value);
#  278|                                           found_value = true;