NetworkManager/clients/cli
Thomas Haller 2e5c4abc8c
cli: fix leak in print_wifi_connection()
Found by Coverity:

  Error: RESOURCE_LEAK (CWE-772): [#def297] [important]
  NetworkManager-1.31.3/src/nmcli/devices.c:4610: alloc_fn: Storage is returned from allocation function "nm_utils_ssid_to_utf8".
  NetworkManager-1.31.3/src/nmcli/devices.c:4610: var_assign: Assigning: "ssid" = storage returned from "nm_utils_ssid_to_utf8(g_bytes_get_data(ssid_bytes, NULL), g_bytes_get_size(ssid_bytes))".
  NetworkManager-1.31.3/src/nmcli/devices.c:4612: noescape: Resource "ssid" is not freed or pointed-to in "g_print".
  NetworkManager-1.31.3/src/nmcli/devices.c:4642: noescape: Resource "ssid" is not freed or pointed-to in "string_append_mecard".
  NetworkManager-1.31.3/src/nmcli/devices.c:4654: leaked_storage: Variable "ssid" going out of scope leaks the storage it points to.
  # 4652|
  # 4653|       g_print("\n");
  # 4654|-> }
  # 4655|
  # 4656|   static gboolean

Fixes: 7061341a41 ('cli: add "nmcli d wifi show"')
(cherry picked from commit e5f37477c0)
2021-06-04 21:30:49 +02:00
..
agent.c all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
common.c all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
common.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
connections.c all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
connections.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
devices.c cli: fix leak in print_wifi_connection() 2021-06-04 21:30:49 +02:00
devices.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
general.c all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
generate-docs-nm-settings-nmcli.c all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
generate-docs-nm-settings-nmcli.xml.in setting-8021x: Fix descriptions for phase2-auth & phase2-autheap 2021-02-09 17:09:31 +01:00
meson.build all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
nmcli-completion cli: make nmcli do its own command completion 2017-02-13 16:32:15 +01:00
nmcli.c all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
nmcli.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
polkit-agent.c all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
polkit-agent.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
settings.c all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
settings.h all: move shared/nm-meta-setting.[hc] to libnm-core and clients 2021-02-09 12:38:19 +01:00
utils.c all: add "libnm/nm-default-client.h" as replacement for "nm-default.h" 2021-02-09 12:38:17 +01:00
utils.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00