From aceb0cf5984aa9c28aa7feed17f8ecde952d5718 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 14 Jan 2011 17:59:24 +0000 Subject: [PATCH 3/7] update_desktop_file_entry: make scope of exec_tmp as short as possible Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33126 --- bus/activation.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bus/activation.c b/bus/activation.c index 0721704..af02825 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -310,6 +310,10 @@ update_desktop_file_entry (BusActivation *activation, error)) goto failed; + exec = _dbus_strdup (_dbus_replace_install_prefix (exec_tmp)); + dbus_free (exec_tmp); + exec_tmp = NULL; + /* user is not _required_ unless we are using system activation */ if (!bus_desktop_file_get_string (desktop_file, DBUS_SERVICE_SECTION, @@ -360,8 +364,6 @@ update_desktop_file_entry (BusActivation *activation, entry = _dbus_hash_table_lookup_string (s_dir->entries, _dbus_string_get_const_data (filename)); - exec = _dbus_strdup (_dbus_replace_install_prefix (exec_tmp)); - if (entry == NULL) /* New file */ { /* FIXME we need a better-defined algorithm for which service file to @@ -453,7 +455,6 @@ update_desktop_file_entry (BusActivation *activation, failed: dbus_free (name); - dbus_free (exec_tmp); dbus_free (user); dbus_free (systemd_service); _dbus_string_free (&file_path); -- 1.7.2.3