From a7a026043b7d9f2caff174d10a8d07d1c675c063 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Mon, 14 Mar 2011 18:45:39 +0200 Subject: Do not pass NULL to xstrdup --- util/mount.fuse.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'util') 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); } } -- cgit v1.2.3