summaryrefslogtreecommitdiffstats
path: root/bus
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-01-25 01:26:49 +0000
committerHavoc Pennington <hp@redhat.com>2003-01-25 01:26:49 +0000
commita1a53c32422230fb76e8e3bca67c877dd2857563 (patch)
tree7b9b348cee61d6ba6ec7595df5e0b0cc3e9d32ed /bus
parenta284b8071436e02064074e08d56dfcc6702c5250 (diff)
2003-01-24 Havoc Pennington <hp@pobox.com>
* dbus/dbus-list.c (alloc_link): put a thread lock on the global list_pool * bus/driver.c (bus_driver_handle_list_services): fix a leak on OOM
Diffstat (limited to 'bus')
-rw-r--r--bus/driver.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bus/driver.c b/bus/driver.c
index da167bbe..eacca934 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -248,7 +248,7 @@ bus_driver_handle_list_services (DBusConnection *connection,
services = bus_services_list (&len);
if (!services)
- return;
+ goto error;
if (!dbus_message_append_fields (reply,
DBUS_TYPE_STRING_ARRAY, services, len,
@@ -260,9 +260,12 @@ bus_driver_handle_list_services (DBusConnection *connection,
error:
dbus_message_unref (reply);
- for (i = 0; i < len; i++)
- dbus_free (services[i]);
- dbus_free (services);
+ if (services != NULL)
+ {
+ for (i = 0; i < len; i++)
+ dbus_free (services[i]);
+ dbus_free (services);
+ }
}
/* This is where all the magic occurs */