From: Andreas Schwab Date: Mon, 10 Apr 2006 09:33:40 +0000 (+0000) Subject: (gethomedir): Make sure to always return a pointer that X-Git-Tag: emacs-pretest-22.0.90~3235 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f8f107772d5625ac1a471a9858284c16cb343330;p=emacs.git (gethomedir): Make sure to always return a pointer that can be passed to free. --- diff --git a/src/ChangeLog b/src/ChangeLog index d5e4d20111e..9c7d551ce7f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-04-10 Andreas Schwab + + * xrdb.c (gethomedir): Make sure to always return a pointer that + can be passed to free. + 2006-04-09 Richard Stallman * lisp.h (Fkill_emacs): Undo previous change. diff --git a/src/xrdb.c b/src/xrdb.c index 2b7888ebe84..c95c98efffd 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -315,7 +315,7 @@ gethomedir () } if (ptr == NULL) - return "/"; + return strcpy ((char *) malloc (2), "/"); copy = (char *) malloc (strlen (ptr) + 2); strcpy (copy, ptr);