From: Karel Zak Date: Tue, 21 Dec 2010 08:54:52 +0000 (+0100) Subject: libmount: don't use NULL pointer in mntenv X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de511a88b1192f2c2c1db52a2fc232a4db4d4faf;p=util-linux libmount: don't use NULL pointer in mntenv Signed-off-by: Karel Zak --- diff --git a/shlibs/mount/src/fs.c b/shlibs/mount/src/fs.c index 61bad7fd..94c35355 100644 --- a/shlibs/mount/src/fs.c +++ b/shlibs/mount/src/fs.c @@ -1364,6 +1364,11 @@ int mnt_fs_to_mntent(mnt_fs *fs, struct mntent **mnt) m->mnt_freq = mnt_fs_get_freq(fs); m->mnt_passno = mnt_fs_get_passno(fs); + if (!m->mnt_fsname) { + m->mnt_fsname = strdup("none"); + if (!m->mnt_fsname) + goto err; + } *mnt = m; return 0;