summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-02-01 13:35:33 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-02-16 14:47:08 +0000
commitd9af45a1faea64f89fe6755fdac776d6166f7d22 (patch)
tree15fcd017823f216a95236a6725c5861595d87150 /bus
parent75cfd97fc23b777a9bed4d6953b62bd5805cda7d (diff)
update_desktop_file_entry: stylistic fixes based on Colin's review
Diffstat (limited to 'bus')
-rw-r--r--bus/activation.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/bus/activation.c b/bus/activation.c
index 5a8eced8..7b2a72bc 100644
--- a/bus/activation.c
+++ b/bus/activation.c
@@ -287,14 +287,14 @@ update_desktop_file_entry (BusActivation *activation,
!_dbus_concat_dir_and_file (&file_path, filename))
{
BUS_SET_OOM (error);
- goto finally;
+ goto out;
}
if (!_dbus_stat (&file_path, &stat_buf, NULL))
{
dbus_set_error (error, DBUS_ERROR_FAILED,
"Can't stat the service file\n");
- goto finally;
+ goto out;
}
if (!bus_desktop_file_get_string (desktop_file,
@@ -302,14 +302,14 @@ update_desktop_file_entry (BusActivation *activation,
DBUS_SERVICE_NAME,
&name,
error))
- goto finally;
+ goto out;
if (!bus_desktop_file_get_string (desktop_file,
DBUS_SERVICE_SECTION,
DBUS_SERVICE_EXEC,
&exec_tmp,
error))
- goto finally;
+ goto out;
exec = _dbus_strdup (_dbus_replace_install_prefix (exec_tmp));
dbus_free (exec_tmp);
@@ -326,7 +326,7 @@ update_desktop_file_entry (BusActivation *activation,
if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
{
dbus_move_error (&tmp_error, error);
- goto finally;
+ goto out;
}
else
{
@@ -349,7 +349,7 @@ update_desktop_file_entry (BusActivation *activation,
if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
{
dbus_move_error (&tmp_error, error);
- goto finally;
+ goto out;
}
else
{
@@ -374,14 +374,14 @@ update_desktop_file_entry (BusActivation *activation,
{
dbus_set_error (error, DBUS_ERROR_FAILED,
"Service %s already exists in activation entry list\n", name);
- goto finally;
+ goto out;
}
entry = dbus_new0 (BusActivationEntry, 1);
if (entry == NULL)
{
BUS_SET_OOM (error);
- goto finally;
+ goto out;
}
entry->name = name;
@@ -401,13 +401,13 @@ update_desktop_file_entry (BusActivation *activation,
if (!entry->filename)
{
BUS_SET_OOM (error);
- goto finally;
+ goto out;
}
if (!_dbus_hash_table_insert_string (activation->entries, entry->name, bus_activation_entry_ref (entry)))
{
BUS_SET_OOM (error);
- goto finally;
+ goto out;
}
if (!_dbus_hash_table_insert_string (s_dir->entries, entry->filename, bus_activation_entry_ref (entry)))
@@ -415,7 +415,7 @@ update_desktop_file_entry (BusActivation *activation,
/* Revert the insertion in the entries table */
_dbus_hash_table_remove_string (activation->entries, entry->name);
BUS_SET_OOM (error);
- goto finally;
+ goto out;
}
_dbus_verbose ("Added \"%s\" to list of services\n", entry->name);
@@ -429,21 +429,24 @@ update_desktop_file_entry (BusActivation *activation,
{
_dbus_verbose ("The new service name \"%s\" of service file \"%s\" already in cache, ignoring\n",
name, _dbus_string_get_const_data (&file_path));
- goto finally;
+ goto out;
}
+ /* ownership has been transferred to entry, do not free separately */
dbus_free (entry->name);
- dbus_free (entry->exec);
- dbus_free (entry->user);
- dbus_free (entry->systemd_service);
- entry->systemd_service = systemd_service;
entry->name = name;
- entry->exec = exec;
- entry->user = user;
- /* ownership has been transferred to entry, do not free separately */
name = NULL;
+
+ dbus_free (entry->exec);
+ entry->exec = exec;
exec = NULL;
+
+ dbus_free (entry->user);
+ entry->user = user;
user = NULL;
+
+ dbus_free (entry->systemd_service);
+ entry->systemd_service = systemd_service;
systemd_service = NULL;
if (!_dbus_hash_table_insert_string (activation->entries,
@@ -462,7 +465,7 @@ update_desktop_file_entry (BusActivation *activation,
entry->mtime = stat_buf.mtime;
retval = TRUE;
-finally:
+out:
/* if these have been transferred into entry, the variables will be NULL */
dbus_free (name);
dbus_free (exec);