summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-05-03 10:10:07 +0200
committerThomas Haller <thaller@redhat.com>2018-07-25 17:08:37 +0200
commit41810aad4851b6613a0a1bdda08601c13c3a9e76 (patch)
tree611e2fdd36e68dfd291445a9c7ce85caa12978f5
parent07ea00074b0872e322740dcdbe56705ac6dba698 (diff)
downloadNetworkManager-41810aad4851b6613a0a1bdda08601c13c3a9e76.tar.gz
cli: don't explicitly unset out_to_free argument in NMMetaType.get_nested()
The virtual function NMMetaType.get_nested() has only one caller: nm_meta_abstract_info_get_nested(). That caller makes sure to always pass in an @out_to_free argument, and that it is initialized to NULL.
-rw-r--r--clients/cli/utils.c1
-rw-r--r--clients/common/nm-meta-setting-access.c3
-rw-r--r--clients/common/nm-meta-setting-desc.c2
3 files changed, 2 insertions, 4 deletions
diff --git a/clients/cli/utils.c b/clients/cli/utils.c
index 91b7cca09b..b1e9dfe004 100644
--- a/clients/cli/utils.c
+++ b/clients/cli/utils.c
@@ -62,7 +62,6 @@ _meta_type_nmc_generic_info_get_nested (const NMMetaAbstractInfo *abstract_info,
info = (const NmcMetaGenericInfo *) abstract_info;
- *out_to_free = NULL;
NM_SET_OUT (out_len, NM_PTRARRAY_LEN (info->nested));
return (const NMMetaAbstractInfo *const*) info->nested;
}
diff --git a/clients/common/nm-meta-setting-access.c b/clients/common/nm-meta-setting-access.c
index 26cc7a57e0..fb63dda06f 100644
--- a/clients/common/nm-meta-setting-access.c
+++ b/clients/common/nm-meta-setting-access.c
@@ -213,7 +213,8 @@ nm_meta_abstract_info_get_nested (const NMMetaAbstractInfo *abstract_info,
if (abstract_info->meta_type->get_nested) {
nested = abstract_info->meta_type->get_nested (abstract_info, &l, &f);
- nm_assert ((nested ? g_strv_length ((char **) nested) : 0) == l);
+ nm_assert (NM_PTRARRAY_LEN (nested) == l);
+ nm_assert (!f || nested == f);
if (nested && nested[0]) {
NM_SET_OUT (out_len, l);
*nested_to_free = g_steal_pointer (&f);
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index a52fe3ee38..e8834944b4 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -8186,7 +8186,6 @@ _meta_type_setting_info_editor_get_nested (const NMMetaAbstractInfo *abstract_in
info = (const NMMetaSettingInfoEditor *) abstract_info;
NM_SET_OUT (out_len, info->properties_num);
- *out_to_free = NULL;
return (const NMMetaAbstractInfo *const*) info->properties;
}
@@ -8196,7 +8195,6 @@ _meta_type_property_info_get_nested (const NMMetaAbstractInfo *abstract_info,
gpointer *out_to_free)
{
NM_SET_OUT (out_len, 0);
- *out_to_free = NULL;
return NULL;
}