From f8f107772d5625ac1a471a9858284c16cb343330 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 10 Apr 2006 09:33:40 +0000 Subject: [PATCH] (gethomedir): Make sure to always return a pointer that can be passed to free. --- src/ChangeLog | 5 +++++ src/xrdb.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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); -- 2.39.2