Commit 1f90e886 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

explorer: Fix memory leak when one or more properties are not present on a hal device.

parent 63a74c7d
......@@ -112,7 +112,10 @@ static WINE_EXCEPTION_FILTER(assert_fault)
static void new_device( LibHalContext *ctx, const char *udi )
{
DBusError error;
char *parent, *mount_point, *device, *type;
char *parent = NULL;
char *mount_point = NULL;
char *device = NULL;
char *type = NULL;
p_dbus_error_init( &error );
......@@ -133,15 +136,14 @@ static void new_device( LibHalContext *ctx, const char *udi )
add_dos_device( udi, device, mount_point, type );
if (type) p_libhal_free_string( type );
p_libhal_free_string( parent );
p_libhal_free_string( device );
p_libhal_free_string( mount_point );
/* add property watch for mount point */
p_libhal_device_add_property_watch( ctx, udi, &error );
done:
if (type) p_libhal_free_string( type );
if (parent) p_libhal_free_string( parent );
if (device) p_libhal_free_string( device );
if (mount_point) p_libhal_free_string( mount_point );
p_dbus_error_free( &error );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment