From: Laszlo Papp Date: Mon, 14 Mar 2011 16:45:39 +0000 (+0200) Subject: Do not pass NULL to xstrdup X-Git-Tag: fuse_2_9_0~63 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a7a026043b7d9f2caff174d10a8d07d1c675c063;p=qemu-gpiodev%2Flibfuse.git Do not pass NULL to xstrdup --- 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); } }