summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem.jover@nokia.com>2009-02-21 11:44:37 +0100
committerDanny Kukawka <danny.kukawka@web.de>2009-02-21 11:44:37 +0100
commitd7270f9096ae249b2e318ade8dc2bc92c9c4ced5 (patch)
treea79e6fae0fce79f8e8be84f0a8f8cc03c1cdd1f6
parent92e7f2e8b2a1a36d3ec2b371424719e7078d91da (diff)
fix some memory leaks on normal operation
Fixed some memory leaks on normal operation. Some pointers were being lost when being overwritten by new values, others were just not being freed.
-rw-r--r--hald/create_cache.c1
-rw-r--r--hald/hald_dbus.c6
-rw-r--r--hald/linux/blockdev.c1
-rw-r--r--partutil/partutil.c4
4 files changed, 10 insertions, 2 deletions
diff --git a/hald/create_cache.c b/hald/create_cache.c
index f2e59176..ed42b7f0 100644
--- a/hald/create_cache.c
+++ b/hald/create_cache.c
@@ -703,6 +703,7 @@ di_rules_init (void)
HAL_INFO (("Generating rules done (occupying %d bytes)", header.all_rules_size));
}
+ g_free (cachename_temp);
return num_skipped_fdi_files;
error:
HAL_ERROR (("Error generating fdi cache"));
diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index 697fb75e..c0cb8c27 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -4158,8 +4158,12 @@ hald_exec_method_cb (HalDevice *d, guint32 exit_type,
dbus_message_unref (reply);
} else if (exp_name != NULL && exp_detail != NULL) {
if (!is_valid_interface_name (exp_name)) {
- exp_detail = g_strconcat (exp_name, " \n ", exp_detail, NULL);
+ gchar *old_detail = exp_detail;
+
+ exp_detail = g_strconcat (exp_name, " \n ", old_detail, NULL);
exp_name = "org.freedesktop.Hal.Device.UnknownError";
+
+ g_free (old_detail);
}
reply = dbus_message_new_error (message, exp_name, exp_detail);
if (reply == NULL) {
diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
index ec4e4053..3fbb51aa 100644
--- a/hald/linux/blockdev.c
+++ b/hald/linux/blockdev.c
@@ -967,6 +967,7 @@ hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const gchar *device_f
link = g_strdup_printf ("%s/%s", path, dp->d_name);
target = resolve_symlink (link);
HAL_INFO ((" %s -> %s", link, target));
+ g_free (link);
if (target != NULL) {
HalDevice *slave_volume;
diff --git a/partutil/partutil.c b/partutil/partutil.c
index 42280af7..3f0ec618 100644
--- a/partutil/partutil.c
+++ b/partutil/partutil.c
@@ -719,8 +719,10 @@ part_table_parse_gpt (int fd, guint64 offset, guint64 size)
partition_type_guid = get_le_guid (gpt_part_entry.partition_type_guid);
- if (strcmp (partition_type_guid, GPT_PART_TYPE_GUID_EMPTY) == 0)
+ if (strcmp (partition_type_guid, GPT_PART_TYPE_GUID_EMPTY) == 0) {
+ g_free (partition_type_guid);
continue;
+ }
pe = part_entry_new (NULL,
(guint8*) &gpt_part_entry,