diff options
author | Thomas Haller <thaller@redhat.com> | 2014-10-01 13:37:57 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-10-03 11:21:17 +0200 |
commit | 284a14d62f005b95d1be4bb1d57d88c7d28a18c7 (patch) | |
tree | 63c0d682fe0899011c0552415cbf5bb98c336d0b | |
parent | 94331184d87e7db3b17f805a95cc29570d8c9c83 (diff) | |
download | NetworkManager-284a14d62f005b95d1be4bb1d57d88c7d28a18c7.tar.gz |
libnm: assert for interface name in _nm_object_class_add_interface()
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | libnm/nm-object.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libnm/nm-object.c b/libnm/nm-object.c index cab92e9b97..e97a14ab12 100644 --- a/libnm/nm-object.c +++ b/libnm/nm-object.c @@ -498,9 +498,12 @@ _nm_object_class_add_interface (NMObjectClass *object_class, NMObjectClassPrivate *cpriv; g_return_if_fail (NM_IS_OBJECT_CLASS (object_class)); + g_return_if_fail (interface); cpriv = NM_OBJECT_CLASS_GET_PRIVATE (object_class); + g_return_if_fail (g_slist_find_custom (cpriv->interfaces, interface, (GCompareFunc) g_strcmp0) == NULL); + cpriv->interfaces = g_slist_prepend (cpriv->interfaces, g_strdup (interface)); } |