Task #91408 - added.err

back to task #91408
download
Error: GCC_ANALYZER_WARNING (CWE-401):
libguestfs-1.58.0/common/options/keys.c:220:35: warning[-Wanalyzer-malloc-leak]: leak of 'key.<Ufdc0>.string.s'
libguestfs-1.58.0/common/options/keys.c:218:1: enter_function: entry to 'key_store_add_from_selector'
libguestfs-1.58.0/common/options/keys.c:225:6: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:227:17: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:230:6: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:232:12: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:233:6: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:237:6: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:237:6: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:240:7: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:242:8: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:246:34: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:246:20: acquire_memory: allocated here
libguestfs-1.58.0/common/options/keys.c:247:8: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:265:10: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:265:10: call_function: calling 'key_store_import_key' from 'key_store_add_from_selector'
libguestfs-1.58.0/common/options/keys.c:265:10: return_function: returning to 'key_store_add_from_selector' from 'key_store_import_key'
libguestfs-1.58.0/common/options/keys.c:220:35: throw: if 'guestfs_int_cleanup_free_string_list' throws an exception...
libguestfs-1.58.0/common/options/keys.c:220:35: danger: 'key.<Ufdc0>.string.s' leaks here; was allocated at [(12)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/11)
#  218|   key_store_add_from_selector (struct key_store *ks, const char *selector)
#  219|   {
#  220|->   CLEANUP_FREE_STRING_LIST char **fields = NULL;
#  221|     size_t field_count;
#  222|     struct key_store_key key;

Error: GCC_ANALYZER_WARNING (CWE-401):
libguestfs-1.58.0/common/options/keys.c:266:1: warning[-Wanalyzer-malloc-leak]: leak of 'key.<Ufdc0>.string.s'
libguestfs-1.58.0/common/options/keys.c:218:1: enter_function: entry to 'key_store_add_from_selector'
libguestfs-1.58.0/common/options/keys.c:225:6: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:227:17: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:230:6: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:232:12: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:233:6: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:237:6: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:237:6: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:240:7: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:242:8: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:246:34: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:246:20: acquire_memory: allocated here
libguestfs-1.58.0/common/options/keys.c:247:8: branch_false: following 'false' branch...
libguestfs-1.58.0/common/options/keys.c:265:10: branch_false: ...to here
libguestfs-1.58.0/common/options/keys.c:265:10: call_function: calling 'key_store_import_key' from 'key_store_add_from_selector'
libguestfs-1.58.0/common/options/keys.c:265:10: return_function: returning to 'key_store_add_from_selector' from 'key_store_import_key'
libguestfs-1.58.0/common/options/keys.c:266:1: danger: 'key.<Ufdc0>.string.s' leaks here; was allocated at [(12)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/11)
#  264|   
#  265|     return key_store_import_key (ks, &key);
#  266|-> }
#  267|   
#  268|   /* Turn /dev/mapper/VG-LV into /dev/VG/LV, in-place. */

Error: CPPCHECK_WARNING (CWE-401):
libguestfs-1.58.0/daemon/caml-stubs.c:294: error[memleak]: Memory leak: ret
#  292|     v = Field (retv, 13);
#  293|     ret->app2_class = strdup (String_val (v));
#  294|->   if (ret->app2_class == NULL) return NULL;
#  295|     v = Field (retv, 14);
#  296|     ret->app2_spare2 = strdup (String_val (v));

Error: GCC_ANALYZER_WARNING (CWE-775):
libguestfs-1.58.0/daemon/checksum.c:112:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libguestfs-1.58.0/daemon/checksum.c:110:1: enter_function: entry to ‘do_checksum_device’
libguestfs-1.58.0/daemon/checksum.c:114:8: acquire_resource: opened here
libguestfs-1.58.0/daemon/checksum.c:115:6: branch_false: following ‘false’ branch...
libguestfs-1.58.0/daemon/checksum.c:120:10: branch_false: ...to here
libguestfs-1.58.0/daemon/checksum.c:120:10: call_function: calling ‘checksum’ from ‘do_checksum_device’
libguestfs-1.58.0/daemon/checksum.c:112:21: throw: if ‘guestfs_int_cleanup_close’ throws an exception...
libguestfs-1.58.0/daemon/checksum.c:112:21: danger: ‘fd’ leaks here; was opened at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#  110|   do_checksum_device (const char *csumtype, const char *device)
#  111|   {
#  112|->   CLEANUP_CLOSE int fd = -1;
#  113|   
#  114|     fd = open (device, O_RDONLY|O_CLOEXEC);

Error: GCC_ANALYZER_WARNING (CWE-401):
libguestfs-1.58.0/daemon/device-name-translation.c:302:22: warning[-Wanalyzer-malloc-leak]: leak of ‘device_name’
libguestfs-1.58.0/daemon/device-name-translation.c:298:1: enter_function: entry to ‘reverse_btrfsvol’
libguestfs-1.58.0/daemon/device-name-translation.c:308:17: acquire_memory: allocated here
libguestfs-1.58.0/daemon/device-name-translation.c:309:6: branch_false: following ‘false’ branch...
libguestfs-1.58.0/daemon/device-name-translation.c:314:21: branch_false: ...to here
libguestfs-1.58.0/daemon/device-name-translation.c:314:21: call_function: calling ‘reverse_device_name_translation’ from ‘reverse_btrfsvol’
libguestfs-1.58.0/daemon/device-name-translation.c:303:22: throw: if ‘guestfs_int_cleanup_free’ throws an exception...
libguestfs-1.58.0/daemon/device-name-translation.c:302:22: throw: if ‘guestfs_int_cleanup_free’ throws an exception...
libguestfs-1.58.0/daemon/device-name-translation.c:302:22: danger: ‘device_name’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  300|     const char prefix[] = "btrfsvol:";
#  301|     const char *device_start, *device_end;
#  302|->   CLEANUP_FREE char *device_name = NULL;
#  303|     CLEANUP_FREE char *reversed_device = NULL;
#  304|     char *ret;

Error: GCC_ANALYZER_WARNING (CWE-404):
libguestfs-1.58.0/lib/actions-variants.c:4453:3: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libguestfs-1.58.0/lib/actions-variants.c:4433:1: enter_function: entry to 'guestfs_xfs_repair'
libguestfs-1.58.0/lib/actions-variants.c:4441:3: acquire_resource: 'va_start' called here
libguestfs-1.58.0/lib/actions-variants.c:4442:7: call_function: calling 'guestfs_xfs_repair_va' from 'guestfs_xfs_repair'
# 4451|                          va_list args)
# 4452|   {
# 4453|->   ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&g->lock);
# 4454|     struct guestfs_xfs_repair_argv optargs_s;
# 4455|     struct guestfs_xfs_repair_argv *optargs = &optargs_s;

Error: GCC_ANALYZER_WARNING (CWE-775):
libguestfs-1.58.0/lib/inspect-apps.c:208:10: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(guestfs_int_download_to_tmp(g, "/var/lib/dpkg/status", 0, 50000000), "r")'
libguestfs-1.58.0/lib/inspect-apps.c:198:6: branch_false: following 'false' branch...
libguestfs-1.58.0/lib/inspect-apps.c:201:8: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:201:8: acquire_resource: opened here
libguestfs-1.58.0/lib/inspect-apps.c:202:6: branch_false: following 'false' branch...
libguestfs-1.58.0/lib/inspect-apps.c:208:10: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:208:10: throw: if 'guestfs_int_safe_malloc' throws an exception...
libguestfs-1.58.0/lib/inspect-apps.c:208:10: danger: 'fopen(guestfs_int_download_to_tmp(g, "/var/lib/dpkg/status", 0, 50000000), "r")' leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  206|   
#  207|     /* Allocate 'apps' list. */
#  208|->   apps = safe_malloc (g, sizeof *apps);
#  209|     apps->len = 0;
#  210|     apps->val = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401):
libguestfs-1.58.0/lib/inspect-apps.c:208:10: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(guestfs_int_download_to_tmp(g, "/var/lib/dpkg/status", 0, 50000000), "r")'
libguestfs-1.58.0/lib/inspect-apps.c:198:6: branch_false: following 'false' branch...
libguestfs-1.58.0/lib/inspect-apps.c:201:8: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:201:8: acquire_memory: allocated here
libguestfs-1.58.0/lib/inspect-apps.c:202:6: branch_false: following 'false' branch...
libguestfs-1.58.0/lib/inspect-apps.c:208:10: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:208:10: throw: if 'guestfs_int_safe_malloc' throws an exception...
libguestfs-1.58.0/lib/inspect-apps.c:208:10: danger: 'fopen(guestfs_int_download_to_tmp(g, "/var/lib/dpkg/status", 0, 50000000), "r")' leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  206|   
#  207|     /* Allocate 'apps' list. */
#  208|->   apps = safe_malloc (g, sizeof *apps);
#  209|     apps->len = 0;
#  210|     apps->val = NULL;

Error: GCC_ANALYZER_WARNING (CWE-775):
libguestfs-1.58.0/lib/inspect-apps.c:225:9: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(guestfs_int_download_to_tmp(g, "/var/lib/dpkg/status", 0, 50000000), "r")'
libguestfs-1.58.0/lib/inspect-apps.c:198:6: branch_false: following 'false' branch...
libguestfs-1.58.0/lib/inspect-apps.c:201:8: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:201:8: acquire_resource: opened here
libguestfs-1.58.0/lib/inspect-apps.c:202:6: branch_false: following 'false' branch...
libguestfs-1.58.0/lib/inspect-apps.c:208:10: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:215:10: branch_true: following 'true' branch...
libguestfs-1.58.0/lib/inspect-apps.c:216:11: branch_true: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:225:9: branch_false: following 'false' branch (when 'continuation_field' is NULL)...
libguestfs-1.58.0/lib/inspect-apps.c:251:9: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:251:8: branch_true: following 'true' branch...
libguestfs-1.58.0/lib/inspect-apps.c:252:7: branch_true: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:253:14: throw: if 'guestfs_int_safe_strdup' throws an exception...
libguestfs-1.58.0/lib/inspect-apps.c:225:9: danger: 'fopen(guestfs_int_download_to_tmp(g, "/var/lib/dpkg/status", 0, 50000000), "r")' leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  223|        * checking for other headers.
#  224|        */
#  225|->     if (line[0] == ' ' && continuation_field) {
#  226|         /* This is a continuation line, and this is the first line of
#  227|          * the field.

Error: GCC_ANALYZER_WARNING (CWE-401):
libguestfs-1.58.0/lib/inspect-apps.c:225:9: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(guestfs_int_download_to_tmp(g, "/var/lib/dpkg/status", 0, 50000000), "r")'
libguestfs-1.58.0/lib/inspect-apps.c:198:6: branch_false: following 'false' branch...
libguestfs-1.58.0/lib/inspect-apps.c:201:8: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:201:8: acquire_memory: allocated here
libguestfs-1.58.0/lib/inspect-apps.c:202:6: branch_false: following 'false' branch...
libguestfs-1.58.0/lib/inspect-apps.c:208:10: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:215:10: branch_true: following 'true' branch...
libguestfs-1.58.0/lib/inspect-apps.c:216:11: branch_true: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:225:9: branch_false: following 'false' branch (when 'continuation_field' is NULL)...
libguestfs-1.58.0/lib/inspect-apps.c:251:9: branch_false: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:251:8: branch_true: following 'true' branch...
libguestfs-1.58.0/lib/inspect-apps.c:252:7: branch_true: ...to here
libguestfs-1.58.0/lib/inspect-apps.c:253:14: throw: if 'guestfs_int_safe_strdup' throws an exception...
libguestfs-1.58.0/lib/inspect-apps.c:225:9: danger: 'fopen(guestfs_int_download_to_tmp(g, "/var/lib/dpkg/status", 0, 50000000), "r")' leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  223|        * checking for other headers.
#  224|        */
#  225|->     if (line[0] == ' ' && continuation_field) {
#  226|         /* This is a continuation line, and this is the first line of
#  227|          * the field.

Error: CLIPPY_WARNING:
src/guestfs.rs:16135:59: warning: this expression borrows a value the compiler would automatically borrow
#        |
#  16135 | ...   let r = unsafe { guestfs_umount_opts_argv(self.g, (&c_pathordevice).as_ptr(), &(RawUmountOptArgs::from(&optargs_cexpr)) as *const R...
#        |                                                         ^^^^^^^^^^^^^^^^^ help: change this to: `c_pathordevice`
#        |
#        = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#needless_borrow