]> git.eshelyaron.com Git - emacs.git/commitdiff
(gethomedir): Make sure to always return a pointer that
authorAndreas Schwab <schwab@suse.de>
Mon, 10 Apr 2006 09:33:40 +0000 (09:33 +0000)
committerAndreas Schwab <schwab@suse.de>
Mon, 10 Apr 2006 09:33:40 +0000 (09:33 +0000)
can be passed to free.

src/ChangeLog
src/xrdb.c

index d5e4d20111eff1950d22f7ef78eead1b39d5d5c2..9c7d551ce7f289f7f7fe35095c1c945947f9f8f1 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-10  Andreas Schwab  <schwab@suse.de>
+
+       * xrdb.c (gethomedir): Make sure to always return a pointer that
+       can be passed to free.
+
 2006-04-09  Richard Stallman  <rms@gnu.org>
 
        * lisp.h (Fkill_emacs): Undo previous change.
index 2b7888ebe84d91bcfe1c8df21bb657c8790ae802..c95c98efffd8e768df37f0eef58051de6be4962b 100644 (file)
@@ -315,7 +315,7 @@ gethomedir ()
     }
 
   if (ptr == NULL)
-    return "/";
+    return strcpy ((char *) malloc (2), "/");
 
   copy = (char *) malloc (strlen (ptr) + 2);
   strcpy (copy, ptr);