aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorGravatar Laszlo Papp <ext-laszlo.papp@nokia.com>2011-03-14 18:45:39 +0200
committerGravatar Miklos Szeredi <mszeredi@suse.cz>2011-03-30 19:34:58 +0200
commita7a026043b7d9f2caff174d10a8d07d1c675c063 (patch)
tree2d15afe3829aead6c74417ab3d698363042d66cf /util
parent61aff393dc414ae6650ba24a1012be0e7bcec5a0 (diff)
Do not pass NULL to xstrdup
Diffstat (limited to 'util')
-rw-r--r--util/mount.fuse.c20
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);
}
}