diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-04-27 03:18:20 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-04-27 03:18:20 +0000 |
commit | 4463a96c8c8a32173030efdc9294ecce9b1fbd6d (patch) | |
tree | 6ea429112dafb1d161b0d77439ab3a7d3246fa69 /src/xrdb.c | |
parent | 1fad23cebeffd31ceaec00ff4e627a14b3491f75 (diff) | |
download | emacs-4463a96c8c8a32173030efdc9294ecce9b1fbd6d.tar.gz |
(get_user_app): Free the gethomedir value.
Diffstat (limited to 'src/xrdb.c')
-rw-r--r-- | src/xrdb.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/xrdb.c b/src/xrdb.c index be1b9cbab1d..9105f6ea763 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -403,6 +403,7 @@ get_user_app (class) { 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 @@ get_user_app (class) /* 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; } |