changeset 69911:d7af35bb9874

(gethomedir): Make sure to always return a pointer that can be passed to free.
author Andreas Schwab <schwab@suse.de>
date Mon, 10 Apr 2006 09:33:30 +0000
parents e6d430f1cde3
children 7ac0100a3441
files src/xrdb.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xrdb.c	Mon Apr 10 09:18:11 2006 +0000
+++ b/src/xrdb.c	Mon Apr 10 09:33:30 2006 +0000
@@ -315,7 +315,7 @@
     }
 
   if (ptr == NULL)
-    return "/";
+    return strcpy ((char *) malloc (2), "/");
 
   copy = (char *) malloc (strlen (ptr) + 2);
   strcpy (copy, ptr);