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)
|
if (!siz)
|
||||||
eprintf("grabmntinfo:");
|
eprintf("grabmntinfo:");
|
||||||
|
|
||||||
for (i = 0; i < siz; i++)
|
for (i = 0; i < siz; i++) {
|
||||||
mnt_show(minfo[i].fsname, minfo[i].mntdir);
|
mnt_show(minfo[i].fsname, minfo[i].mntdir);
|
||||||
|
free(minfo[i].fsname);
|
||||||
|
free(minfo[i].mntdir);
|
||||||
|
}
|
||||||
free(minfo);
|
free(minfo);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
|
||||||
struct mntinfo {
|
struct mntinfo {
|
||||||
const char *fsname;
|
char *fsname;
|
||||||
const char *mntdir;
|
char *mntdir;
|
||||||
};
|
};
|
||||||
|
|
||||||
int grabmntinfo(struct mntinfo **minfo);
|
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)
|
if (mount(source, target, types, flags, data) < 0)
|
||||||
eprintf("mount:");
|
eprintf("mount:");
|
||||||
|
|
||||||
|
for (i = 0; i < siz; i++) {
|
||||||
|
free(minfo[i].fsname);
|
||||||
|
free(minfo[i].mntdir);
|
||||||
|
}
|
||||||
free(minfo);
|
free(minfo);
|
||||||
|
|
||||||
opt = opthead;
|
opt = opthead;
|
||||||
|
|
|
@ -72,6 +72,11 @@ main(int argc, char *argv[])
|
||||||
st1.st_ino == st2.st_ino)
|
st1.st_ino == st2.st_ino)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < siz; i++) {
|
||||||
|
free(minfo[i].fsname);
|
||||||
|
free(minfo[i].mntdir);
|
||||||
|
}
|
||||||
free(minfo);
|
free(minfo);
|
||||||
|
|
||||||
if (i == siz)
|
if (i == siz)
|
||||||
|
|
Loading…
Reference in New Issue