changeset 17572:73d867b4a654

(get_user_app): Free the gethomedir value.
author Richard M. Stallman <rms@gnu.org>
date Sun, 27 Apr 1997 03:18:20 +0000
parents e4c551837753
children bfd86808adcc
files src/xrdb.c
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/xrdb.c	Sat Apr 26 22:14:21 1997 +0000
+++ b/src/xrdb.c	Sun Apr 27 03:18:20 1997 +0000
@@ -403,6 +403,7 @@
 {
   char *path;
   char *file = 0;
+  char *free_it = 0;
 
   /* Check for XUSERFILESEARCHPATH.  It is a path of complete file
      names, not directories.  */
@@ -417,16 +418,20 @@
       
       /* Check in the home directory.  This is a bit of a hack; let's
 	 hope one's home directory doesn't contain any %-escapes.  */
-      || (path = gethomedir (),
-	  ((file = search_magic_path (path, class, "%L/%N", 0))
-	   || (file = search_magic_path (path, class, "%N", 0)))))
+      || (free_it = gethomedir (),
+	  ((file = search_magic_path (free_it, class, "%L/%N", 0))
+	   || (file = search_magic_path (free_it, class, "%N", 0)))))
     {
       XrmDatabase db = XrmGetFileDatabase (file);
       free (file);
+      if (free_it)
+	free (free_it);
       return db;
     }
-  else
-    return NULL;
+
+  if (free_it)
+    free (free_it);
+  return NULL;
 }