projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bc581d1
)
(read_filesystem_list): Fix more memory leaks on failure.
author
Jim Meyering
<jim@meyering.net>
Sat, 18 Jul 1998 12:28:31 +0000
(12:28 +0000)
committer
Jim Meyering
<jim@meyering.net>
Sat, 18 Jul 1998 12:28:31 +0000
(12:28 +0000)
From Andreas Schwab.
lib/mountlist.c
patch
|
blob
|
history
diff --git
a/lib/mountlist.c
b/lib/mountlist.c
index 044a77055b0b4f38cc20b80aa3c58ceaba1e0ce3..28bd220a19e4841e179dbbf357f32ae62fde3334 100644
(file)
--- a/
lib/mountlist.c
+++ b/
lib/mountlist.c
@@
-287,8
+287,7
@@
fstype_to_string (t)
are automounter (dummy) entries. */
struct mount_entry *
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;
{
struct mount_entry *mount_list;
struct mount_entry *me;
@@
-651,10
+650,13
@@
read_filesystem_list (need_fs_type, all_fs)
{
int saved_errno = errno;
*mtail = NULL;
{
int saved_errno = errno;
*mtail = NULL;
-
+
while (mount_list)
{
me = mount_list->me_next;
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;
}
free (mount_list);
mount_list = me;
}