summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-03-13 09:39:27 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2018-04-13 17:02:55 +0200
commitc9a574f12f976fadb5591064fcec35106c957631 (patch)
treeb2bd93e8808dd32844350e5a7a53c77776a8bcd1
parent9a19bbcb2f6b78be2541334a0d650e765a11fa2b (diff)
downloadNetworkManager-c9a574f12f976fadb5591064fcec35106c957631.tar.gz
clients: use nm_utils_strv_make_deep_copied() to deep copy const strv array
-rw-r--r--clients/common/nm-meta-setting-desc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index d3716d6003..ede95a10a3 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -1328,7 +1328,7 @@ _values_fcn_gobject_enum (ARGS_VALUES_FCN)
gboolean has_minmax = FALSE;
int min = G_MININT;
int max = G_MAXINT;
- char **v, **w;
+ char **v;
if (property_info->property_typ_data) {
if ( property_info->property_typ_data->subtype.gobject_enum.min
@@ -1362,11 +1362,7 @@ _values_fcn_gobject_enum (ARGS_VALUES_FCN)
/* the gobject_enum.value_infos are currently ignored for the list of
* values. They only declare additional (hidden) aliases for the setter. */
- v = (char **) nm_utils_enum_get_values (gtype, min, max);
- if (v) {
- for (w = v; *w; w++)
- *w = g_strdup (*w);
- }
+ v = nm_utils_strv_make_deep_copied (nm_utils_enum_get_values (gtype, min, max));
return (const char *const*) (*out_to_free = v);
}