mirror of git://git.suckless.org/ubase
Free minfo table
This commit is contained in:
parent
4040857074
commit
5b0d03acc6
5
df.c
5
df.c
|
@ -35,8 +35,11 @@ main(int argc, char *argv[])
|
|||
if (!siz)
|
||||
eprintf("grabmntinfo:");
|
||||
|
||||
for (i = 0; i < siz; i++)
|
||||
for (i = 0; i < siz; i++) {
|
||||
mnt_show(minfo[i].fsname, minfo[i].mntdir);
|
||||
free(minfo[i].fsname);
|
||||
free(minfo[i].mntdir);
|
||||
}
|
||||
free(minfo);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
struct mntinfo {
|
||||
const char *fsname;
|
||||
const char *mntdir;
|
||||
char *fsname;
|
||||
char *mntdir;
|
||||
};
|
||||
|
||||
int grabmntinfo(struct mntinfo **minfo);
|
||||
|
|
4
mount.c
4
mount.c
|
@ -149,6 +149,10 @@ main(int argc, char *argv[])
|
|||
if (mount(source, target, types, flags, data) < 0)
|
||||
eprintf("mount:");
|
||||
|
||||
for (i = 0; i < siz; i++) {
|
||||
free(minfo[i].fsname);
|
||||
free(minfo[i].mntdir);
|
||||
}
|
||||
free(minfo);
|
||||
|
||||
opt = opthead;
|
||||
|
|
|
@ -72,6 +72,11 @@ main(int argc, char *argv[])
|
|||
st1.st_ino == st2.st_ino)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < siz; i++) {
|
||||
free(minfo[i].fsname);
|
||||
free(minfo[i].mntdir);
|
||||
}
|
||||
free(minfo);
|
||||
|
||||
if (i == siz)
|
||||
|
|
Loading…
Reference in New Issue