NetworkManager/clients/cli
Thomas Haller 36f73d041d
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)
(cherry picked from commit 2e5c4abc8c)
2021-06-10 16:20:32 +02:00
..
agent.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
common.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
common.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
connections.c cli: fix showing active state for nmcli con show with fields 2020-10-09 10:24:02 +02:00
connections.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
devices.c cli: fix leak in print_wifi_connection() 2021-06-10 16:20:32 +02:00
devices.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
general.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
generate-docs-nm-settings-nmcli.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
meson.build docs: generate nm-settings-docs-nmcli.xml based on nmcli meta data 2020-06-11 10:53:50 +02:00
nmcli-completion cli: make nmcli do its own command completion 2017-02-13 16:32:15 +01:00
nmcli.c cli: honor and prefer color schemes with ".scheme" extension 2020-10-09 09:56:11 +02:00
nmcli.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
polkit-agent.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
polkit-agent.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
settings.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
settings.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
utils.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
utils.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00