diff options
author | Thomas Haller <thaller@redhat.com> | 2018-05-03 10:10:07 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-06-13 15:29:41 +0200 |
commit | a3de529e814567357a7d69b20f045c05b7853e55 (patch) | |
tree | 9af06c8dc7346192c7efc68d65dff716c7d5391f | |
parent | a5dc9efd40addaabaa0f91fe9e9054b189825795 (diff) | |
download | NetworkManager-a3de529e814567357a7d69b20f045c05b7853e55.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.c | 1 | ||||
-rw-r--r-- | clients/common/nm-meta-setting-access.c | 3 | ||||
-rw-r--r-- | clients/common/nm-meta-setting-desc.c | 2 |
3 files changed, 2 insertions, 4 deletions
diff --git a/clients/cli/utils.c b/clients/cli/utils.c index 483edfc6c2..4872678c96 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 2dd872058b..87b859d5e3 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -7963,7 +7963,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; } @@ -7973,7 +7972,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; } |