diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2014-06-05 10:11:27 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2014-06-05 18:11:29 +0200 |
commit | 8b41e6e2eaa6b9418dbbef0ec33c394c2634be08 (patch) | |
tree | 3cd63228c7d0b11bf6ac5bf1014df7f87ccd65b1 /libnm-glib | |
parent | f53a35e030cb7b03515a8470f81a9d10ff72179e (diff) | |
download | NetworkManager-8b41e6e2eaa6b9418dbbef0ec33c394c2634be08.tar.gz |
libnm-glib: fix double unref() when object creation fails
Diffstat (limited to 'libnm-glib')
-rw-r--r-- | libnm-glib/nm-device.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index 43c8dd29c8..2d48265514 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -917,14 +917,15 @@ _nm_device_type_for_path (DBusGConnection *connection, } if (!dbus_g_proxy_call (proxy, - "Get", &err, - G_TYPE_STRING, NM_DBUS_INTERFACE_DEVICE, - G_TYPE_STRING, "DeviceType", - G_TYPE_INVALID, - G_TYPE_VALUE, &value, G_TYPE_INVALID)) { - g_object_unref (proxy); + "Get", &err, + G_TYPE_STRING, NM_DBUS_INTERFACE_DEVICE, + G_TYPE_STRING, "DeviceType", + G_TYPE_INVALID, + G_TYPE_VALUE, &value, G_TYPE_INVALID)) { g_warning ("Error in get_property: %s\n", err->message); g_error_free (err); + g_object_unref (proxy); + return G_TYPE_INVALID; } g_object_unref (proxy); |