]> err.no Git - util-linux/commitdiff
libmount: don't use NULL pointer in mntenv
authorKarel Zak <kzak@redhat.com>
Tue, 21 Dec 2010 08:54:52 +0000 (09:54 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 3 Jan 2011 11:28:47 +0000 (12:28 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/mount/src/fs.c

index 61bad7fd79c9f7a0ac9d074044ee8cc79d85aef2..94c35355801816f990f8f9636b091ded9a4eb366 100644 (file)
@@ -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;