Task #90384 - added.err

back to task #90384
download
Error: GCC_ANALYZER_WARNING (CWE-401):
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:239:12: warning[-Wanalyzer-malloc-leak]: leak of ‘sample_arg’
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:214:6: branch_false: following ‘false’ branch...
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:221:20: branch_false: ...to here
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:221:20: acquire_memory: allocated here
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:222:10: branch_false: following ‘false’ branch (when ‘sample_arg’ is non-NULL)...
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:229:3: branch_false: ...to here
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:238:6: branch_false: following ‘false’ branch (when ‘attached == 0’)...
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:239:12: branch_false: ...to here
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:239:12: throw: if ‘dwfl_attach_state’ throws an exception...
elfutils-0.194/libdwfl_stacktrace/dwflst_sample_frame.c:239:12: danger: ‘sample_arg’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  237|   
#  238|     if (! attached
#  239|->       && ! INTUSE(dwfl_attach_state) (dwfl, elf, pid,
#  240|   				      &sample_thread_callbacks, sample_arg))
#  241|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-401):
elfutils-0.194/src/elfclassify.c:74:5: warning[-Wanalyzer-malloc-leak]: leak of ‘full_path’
elfutils-0.194/src/elfclassify.c:827:1: enter_function: entry to ‘check_ar_members’
elfutils-0.194/src/elfclassify.c:836:21: acquire_memory: allocated here
elfutils-0.194/src/elfclassify.c:837:6: branch_false: following ‘false’ branch (when ‘full_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:837:6: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:846:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:848:26: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:849:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:857:23: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:857:23: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:858:23: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:858:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:860:11: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:862:14: branch_false: following ‘false’ branch (when ‘new_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:872:11: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:872:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:882:7: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:883:11: call_function: calling ‘run_classify’ from ‘check_ar_members’
#   72|   {
#   73|     if (verbose >= 0)
#   74|->     error (0, 0, "%s: %s: '%s'", msg, elf_errmsg (-1), current_path);
#   75|     issue_found = true;
#   76|   }

Error: GCC_ANALYZER_WARNING (CWE-401):
elfutils-0.194/src/elfclassify.c:243:21: warning[-Wanalyzer-malloc-leak]: leak of ‘full_path’
elfutils-0.194/src/elfclassify.c:827:1: enter_function: entry to ‘check_ar_members’
elfutils-0.194/src/elfclassify.c:836:21: acquire_memory: allocated here
elfutils-0.194/src/elfclassify.c:837:6: branch_false: following ‘false’ branch (when ‘full_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:837:6: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:846:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:848:26: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:849:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:857:23: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:857:23: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:858:23: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:858:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:860:11: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:862:14: branch_false: following ‘false’ branch (when ‘new_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:872:11: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:872:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:882:7: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:883:11: call_function: calling ‘run_classify’ from ‘check_ar_members’
#  241|   
#  242|     GElf_Ehdr ehdr_storage;
#  243|->   GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_storage);
#  244|     if (ehdr == NULL)
#  245|       {

Error: GCC_ANALYZER_WARNING (CWE-401):
elfutils-0.194/src/elfclassify.c:255:9: warning[-Wanalyzer-malloc-leak]: leak of ‘full_path’
elfutils-0.194/src/elfclassify.c:827:1: enter_function: entry to ‘check_ar_members’
elfutils-0.194/src/elfclassify.c:836:21: acquire_memory: allocated here
elfutils-0.194/src/elfclassify.c:837:6: branch_false: following ‘false’ branch (when ‘full_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:837:6: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:846:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:848:26: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:849:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:857:23: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:857:23: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:858:23: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:858:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:860:11: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:862:14: branch_false: following ‘false’ branch (when ‘new_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:872:11: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:872:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:882:7: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:883:11: call_function: calling ‘run_classify’ from ‘check_ar_members’
#  253|     {
#  254|       size_t nphdrs;
#  255|->     if (elf_getphdrnum (elf, &nphdrs) != 0)
#  256|         {
#  257|   	elf_issue (N_("program headers"));

Error: GCC_ANALYZER_WARNING (CWE-401):
elfutils-0.194/src/elfclassify.c:263:27: warning[-Wanalyzer-malloc-leak]: leak of ‘full_path’
elfutils-0.194/src/elfclassify.c:827:1: enter_function: entry to ‘check_ar_members’
elfutils-0.194/src/elfclassify.c:836:21: acquire_memory: allocated here
elfutils-0.194/src/elfclassify.c:837:6: branch_false: following ‘false’ branch (when ‘full_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:837:6: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:846:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:848:26: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:849:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:857:23: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:857:23: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:858:23: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:858:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:860:11: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:862:14: branch_false: following ‘false’ branch (when ‘new_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:872:11: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:872:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:882:7: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:883:11: call_function: calling ‘run_classify’ from ‘check_ar_members’
#  261|         {
#  262|   	GElf_Phdr phdr_storage;
#  263|-> 	GElf_Phdr *phdr = gelf_getphdr (elf, phdr_idx, &phdr_storage);
#  264|   	if (phdr == NULL)
#  265|   	  {

Error: GCC_ANALYZER_WARNING (CWE-401):
elfutils-0.194/src/elfclassify.c:284:9: warning[-Wanalyzer-malloc-leak]: leak of ‘full_path’
elfutils-0.194/src/elfclassify.c:827:1: enter_function: entry to ‘check_ar_members’
elfutils-0.194/src/elfclassify.c:836:21: acquire_memory: allocated here
elfutils-0.194/src/elfclassify.c:837:6: branch_false: following ‘false’ branch (when ‘full_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:837:6: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:846:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:848:26: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:849:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:857:23: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:857:23: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:858:23: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:858:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:860:11: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:862:14: branch_false: following ‘false’ branch (when ‘new_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:872:11: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:872:10: branch_false: following ‘false’ branch...
elfutils-0.194/src/elfclassify.c:882:7: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:883:11: call_function: calling ‘run_classify’ from ‘check_ar_members’
#  282|     {
#  283|       size_t nshdrs;
#  284|->     if (elf_getshdrnum (elf, &nshdrs) != 0)
#  285|         {
#  286|   	elf_issue (N_("section headers"));

Error: GCC_ANALYZER_WARNING (CWE-401):
elfutils-0.194/src/elfclassify.c:846:17: warning[-Wanalyzer-malloc-leak]: leak of ‘full_path’
elfutils-0.194/src/elfclassify.c:836:21: acquire_memory: allocated here
elfutils-0.194/src/elfclassify.c:837:6: branch_false: following ‘false’ branch (when ‘full_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:837:6: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:846:17: throw: if ‘elf_begin’ throws an exception...
elfutils-0.194/src/elfclassify.c:846:17: danger: ‘full_path’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  844|     int cmd = ELF_C_READ;
#  845|     bool bad_ar = false;
#  846|->   while ((elf = elf_begin (file_fd, cmd, ar_elf)) != NULL)
#  847|       {
#  848|         Elf_Arhdr *arhdr = elf_getarhdr (elf);

Error: GCC_ANALYZER_WARNING (CWE-401):
elfutils-0.194/src/elfclassify.c:848:26: warning[-Wanalyzer-malloc-leak]: leak of ‘full_path’
elfutils-0.194/src/elfclassify.c:836:21: acquire_memory: allocated here
elfutils-0.194/src/elfclassify.c:837:6: branch_false: following ‘false’ branch (when ‘full_path’ is non-NULL)...
elfutils-0.194/src/elfclassify.c:837:6: branch_false: ...to here
elfutils-0.194/src/elfclassify.c:846:10: branch_true: following ‘true’ branch...
elfutils-0.194/src/elfclassify.c:848:26: branch_true: ...to here
elfutils-0.194/src/elfclassify.c:848:26: throw: if ‘elf_getarhdr’ throws an exception...
elfutils-0.194/src/elfclassify.c:848:26: danger: ‘full_path’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  846|     while ((elf = elf_begin (file_fd, cmd, ar_elf)) != NULL)
#  847|       {
#  848|->       Elf_Arhdr *arhdr = elf_getarhdr (elf);
#  849|         if (arhdr == NULL)
#  850|   	{