diff options
author | Laszlo Papp <ext-laszlo.papp@nokia.com> | 2011-03-14 18:45:39 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2011-03-30 19:34:58 +0200 |
commit | a7a026043b7d9f2caff174d10a8d07d1c675c063 (patch) | |
tree | 2d15afe3829aead6c74417ab3d698363042d66cf /util/mount.fuse.c | |
parent | 61aff393dc414ae6650ba24a1012be0e7bcec5a0 (diff) | |
download | android_external_fuse-a7a026043b7d9f2caff174d10a8d07d1c675c063.tar.gz android_external_fuse-a7a026043b7d9f2caff174d10a8d07d1c675c063.tar.bz2 android_external_fuse-a7a026043b7d9f2caff174d10a8d07d1c675c063.zip |
Do not pass NULL to xstrdup
Diffstat (limited to 'util/mount.fuse.c')
-rw-r--r-- | util/mount.fuse.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/util/mount.fuse.c b/util/mount.fuse.c index b388f9e..6df8c03 100644 --- a/util/mount.fuse.c +++ b/util/mount.fuse.c @@ -185,14 +185,18 @@ int main(int argc, char *argv[]) options = add_option("suid", options); if (!type) { - type = xstrdup(source); - source = strchr(type, '#'); - if (source) - *source++ = '\0'; - - if (!type[0]) { - fprintf(stderr, "%s: empty filesystem type\n", - progname); + if (source) { + type = xstrdup(source); + source = strchr(type, '#'); + if (source) + *source++ = '\0'; + if (!type[0]) { + fprintf(stderr, "%s: empty filesystem type\n", + progname); + exit(1); + } + } else { + fprintf(stderr, "%s: empty source\n", progname); exit(1); } } |