Mercurial > hg > octave-lojdl > gnulib-hg
changeset 1436:5919c19d9a1a
(read_filesystem_list): Fix more memory leaks on failure.
From Andreas Schwab.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sat, 18 Jul 1998 12:28:31 +0000 |
parents | 32eb343d9ccb |
children | 446c5744bcf0 |
files | lib/mountlist.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -287,8 +287,7 @@ are automounter (dummy) entries. */ struct mount_entry * -read_filesystem_list (need_fs_type, all_fs) - int need_fs_type, all_fs; +read_filesystem_list (int need_fs_type, int all_fs) { struct mount_entry *mount_list; struct mount_entry *me; @@ -651,10 +650,13 @@ { int saved_errno = errno; *mtail = NULL; - + while (mount_list) { me = mount_list->me_next; + free (mount_list->me_devname); + free (mount_list->me_mountdir); + /* FIXME: me_type is not always malloced. */ free (mount_list); mount_list = me; }