summaryrefslogtreecommitdiff
path: root/libnm-glib
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2017-02-14 12:43:37 +0000
committerThomas Haller <thaller@redhat.com>2017-02-15 16:30:13 +0100
commit78058f780904d38359165cec11d7ee0735b7addb (patch)
tree98a0ec25d025b065811ee5e27378ba4ffe2fbe31 /libnm-glib
parent84c484ed5b5d40ff42029140dc7b0a20d794ff46 (diff)
libnm-glib: add some missing precondition assertions
To validate the connection and path for NmObject subclass instances. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=778610
Diffstat (limited to 'libnm-glib')
-rw-r--r--libnm-glib/nm-dhcp4-config.c3
-rw-r--r--libnm-glib/nm-dhcp6-config.c3
-rw-r--r--libnm-glib/nm-ip4-config.c3
-rw-r--r--libnm-glib/nm-ip6-config.c3
4 files changed, 12 insertions, 0 deletions
diff --git a/libnm-glib/nm-dhcp4-config.c b/libnm-glib/nm-dhcp4-config.c
index fc3491c89..4acdeae76 100644
--- a/libnm-glib/nm-dhcp4-config.c
+++ b/libnm-glib/nm-dhcp4-config.c
@@ -174,6 +174,9 @@ nm_dhcp4_config_class_init (NMDHCP4ConfigClass *config_class)
GObject *
nm_dhcp4_config_new (DBusGConnection *connection, const char *object_path)
{
+ g_return_val_if_fail (connection != NULL, NULL);
+ g_return_val_if_fail (object_path != NULL, NULL);
+
return (GObject *) g_object_new (NM_TYPE_DHCP4_CONFIG,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, object_path,
diff --git a/libnm-glib/nm-dhcp6-config.c b/libnm-glib/nm-dhcp6-config.c
index 43aee15c7..aebea8df6 100644
--- a/libnm-glib/nm-dhcp6-config.c
+++ b/libnm-glib/nm-dhcp6-config.c
@@ -174,6 +174,9 @@ nm_dhcp6_config_class_init (NMDHCP6ConfigClass *config_class)
GObject *
nm_dhcp6_config_new (DBusGConnection *connection, const char *object_path)
{
+ g_return_val_if_fail (connection != NULL, NULL);
+ g_return_val_if_fail (object_path != NULL, NULL);
+
return (GObject *) g_object_new (NM_TYPE_DHCP6_CONFIG,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, object_path,
diff --git a/libnm-glib/nm-ip4-config.c b/libnm-glib/nm-ip4-config.c
index ae7448f9f..9e0e2e2d2 100644
--- a/libnm-glib/nm-ip4-config.c
+++ b/libnm-glib/nm-ip4-config.c
@@ -330,6 +330,9 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class)
GObject *
nm_ip4_config_new (DBusGConnection *connection, const char *object_path)
{
+ g_return_val_if_fail (connection != NULL, NULL);
+ g_return_val_if_fail (object_path != NULL, NULL);
+
return (GObject *) g_object_new (NM_TYPE_IP4_CONFIG,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, object_path,
diff --git a/libnm-glib/nm-ip6-config.c b/libnm-glib/nm-ip6-config.c
index 320f00f2d..5ec02dae8 100644
--- a/libnm-glib/nm-ip6-config.c
+++ b/libnm-glib/nm-ip6-config.c
@@ -69,6 +69,9 @@ enum {
GObject *
nm_ip6_config_new (DBusGConnection *connection, const char *object_path)
{
+ g_return_val_if_fail (connection != NULL, NULL);
+ g_return_val_if_fail (object_path != NULL, NULL);
+
return (GObject *) g_object_new (NM_TYPE_IP6_CONFIG,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, object_path,