Free session file early in dbus-launch
authorChristian Dywan <christian@lanedo.com>
Thu, 23 Sep 2010 16:21:25 +0000 (09:21 -0700)
committerSimon McVittie <smcv@debian.org>
Wed, 5 Jan 2011 14:55:42 +0000 (14:55 +0000)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29881
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
tools/dbus-launch-x11.c

index 0d37134..0f344ab 100644 (file)
@@ -405,6 +405,7 @@ set_address_in_file (char *address, pid_t pid, Window wid)
     return FALSE;
 
   f = fopen (session_file, "w");
+  free (session_file);
   if (f == NULL)
     return FALSE;               /* some kind of error */
   fprintf (f,
@@ -421,7 +422,6 @@ set_address_in_file (char *address, pid_t pid, Window wid)
            address, (long)pid, (long)wid);
 
   fclose (f);
-  free (session_file);
 
   return TRUE;
 }