From: Simon McVittie Date: Fri, 14 Jan 2011 17:59:24 +0000 (+0000) Subject: update_desktop_file_entry: make scope of exec_tmp as short as possible X-Git-Tag: dbus-1.4.4~2^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d95cc488a83ad56f17e08e282a8ebcc33aa34c92;p=thirdparty%2Fdbus.git update_desktop_file_entry: make scope of exec_tmp as short as possible Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33126 --- diff --git a/bus/activation.c b/bus/activation.c index 0721704f9..af0282557 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);