aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-27 03:18:20 +0000
committerRichard M. Stallman1997-04-27 03:18:20 +0000
commit3fa18fb28a99909edbf7f489322ae5620cc964ec (patch)
tree44a5aa97c6d2e9c2ccff174d1fa9e47f0058fd2e /src
parented8fcefb1455cfa801164aee165e0e7dc1419ef0 (diff)
downloademacs-3fa18fb28a99909edbf7f489322ae5620cc964ec.tar.gz
emacs-3fa18fb28a99909edbf7f489322ae5620cc964ec.zip
(get_user_app): Free the gethomedir value.
Diffstat (limited to 'src')
-rw-r--r--src/xrdb.c15
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)
403{ 403{
404 char *path; 404 char *path;
405 char *file = 0; 405 char *file = 0;
406 char *free_it = 0;
406 407
407 /* Check for XUSERFILESEARCHPATH. It is a path of complete file 408 /* Check for XUSERFILESEARCHPATH. It is a path of complete file
408 names, not directories. */ 409 names, not directories. */
@@ -417,16 +418,20 @@ get_user_app (class)
417 418
418 /* Check in the home directory. This is a bit of a hack; let's 419 /* Check in the home directory. This is a bit of a hack; let's
419 hope one's home directory doesn't contain any %-escapes. */ 420 hope one's home directory doesn't contain any %-escapes. */
420 || (path = gethomedir (), 421 || (free_it = gethomedir (),
421 ((file = search_magic_path (path, class, "%L/%N", 0)) 422 ((file = search_magic_path (free_it, class, "%L/%N", 0))
422 || (file = search_magic_path (path, class, "%N", 0))))) 423 || (file = search_magic_path (free_it, class, "%N", 0)))))
423 { 424 {
424 XrmDatabase db = XrmGetFileDatabase (file); 425 XrmDatabase db = XrmGetFileDatabase (file);
425 free (file); 426 free (file);
427 if (free_it)
428 free (free_it);
426 return db; 429 return db;
427 } 430 }
428 else 431
429 return NULL; 432 if (free_it)
433 free (free_it);
434 return NULL;
430} 435}
431 436
432 437