mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-03 21:50:43 +01:00
core: fix leak in _config_data_get_main_auth_polkit()
Found by Coverity: Error: RESOURCE_LEAK (CWE-772): NetworkManager-1.31.3/src/core/nm-config-data.c:450: alloc_fn: Storage is returned from allocation function "nm_config_data_get_value". NetworkManager-1.31.3/src/core/nm-config-data.c:450: var_assign: Assigning: "str" = storage returned from "nm_config_data_get_value(self, "main", "auth-polkit", (enum [unnamed type of NMConfigGetValueFlags])6)". NetworkManager-1.31.3/src/core/nm-config-data.c:454: noescape: Resource "str" is not freed or pointed-to in "nm_auth_polkit_mode_from_string". NetworkManager-1.31.3/src/core/nm-config-data.c:465: leaked_storage: Variable "str" going out of scope leaks the storage it points to. # 463| NM_SET_OUT(out_invalid_config, FALSE); # 464| # 465|-> return auth_polkit_mode; # 466| } # 467| Fixes:6d7446e52f('core: add main.auth-polkit option "root-only"') (cherry picked from commitceaa1c369f) (cherry picked from commit0392743c48)
This commit is contained in:
parent
a44a8c5eee
commit
14ed2386ae
1 changed files with 1 additions and 1 deletions
|
|
@ -437,7 +437,7 @@ static NMAuthPolkitMode
|
|||
_config_data_get_main_auth_polkit(const NMConfigData *self, gboolean *out_invalid_config)
|
||||
{
|
||||
NMAuthPolkitMode auth_polkit_mode;
|
||||
const char * str;
|
||||
gs_free char * str = NULL;
|
||||
|
||||
str = nm_config_data_get_value(self,
|
||||
NM_CONFIG_KEYFILE_GROUP_MAIN,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue