mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 19:10:09 +01:00
nmcli: fix double free
src/nmcli/devices.c:1196: double_free: Calling "_nm_auto_strfreev" frees pointer "arg_arr" which has already been freed.
Fixes: c5d45848dd ('cli: mark argv argument for command line parsing as const')
This commit is contained in:
parent
d1f010b305
commit
a39ec8ca75
1 changed files with 1 additions and 4 deletions
|
|
@ -1149,7 +1149,7 @@ get_device_list(NmCli *nmc, int *argc, const char *const **argv)
|
|||
if (*argc == 0) {
|
||||
g_string_printf(nmc->return_text, _("Error: No interface specified."));
|
||||
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
|
||||
goto error;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
devices = nmc_get_devices_sorted(nmc->client);
|
||||
|
|
@ -1190,9 +1190,6 @@ get_device_list(NmCli *nmc, int *argc, const char *const **argv)
|
|||
}
|
||||
g_free(devices);
|
||||
|
||||
error:
|
||||
g_strfreev(arg_arr);
|
||||
|
||||
return queue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue