changeset: 24:32d7d65779a8
tag: tip
user: Dimitrios Papastamos <stateless [at] archlinux.us>
date: Fri Dec 04 00:53:02 2009 +0000
files: skvm.c
description:
fixed mem leak.
diff -r 86db9c494a02 -r 32d7d65779a8 skvm.c
--- a/skvm.c Sun Oct 04 12:51:13 2009 +0100
+++ b/skvm.c Fri Dec 04 00:53:02 2009 +0000
@@ -215,7 +215,7 @@
{
if (!(dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, error)))
return -1;
- dbus_connection_setup_with_g_main (dbus_conn, (GMainContext *)NULL);
+ dbus_connection_setup_with_g_main(dbus_conn, (GMainContext *)NULL);
dbus_connection_flush(dbus_conn);
return 0;
}
@@ -228,7 +228,7 @@
if (!(hal_ctx = libhal_ctx_new()))
return -1;
- libhal_ctx_set_dbus_connection (hal_ctx, dbus_conn);
+ libhal_ctx_set_dbus_connection(hal_ctx, dbus_conn);
libhal_ctx_set_device_added(hal_ctx, device_added);
libhal_ctx_set_device_removed(hal_ctx, device_removed);
@@ -413,6 +413,10 @@
device->use_fstab = 0;
device->should_remove_entry = 0;
if (!device->did || !device->label || !device->fstype) {
+ /* freeing null pointers is GOOD */
+ FREE_WRAP(device->did);
+ FREE_WRAP(device->label);
+ FREE_WRAP(device->fstype);
free_device(device);
device = NULL;
}
Received on Fri Dec 04 2009 - 00:53:07 UTC
This archive was generated by hypermail 2.2.0 : Fri Dec 04 2009 - 01:00:08 UTC