nspawn: fix memleak
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 15 Mar 2019 14:53:02 +0000 (23:53 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 15 Mar 2019 14:53:05 +0000 (23:53 +0900)
Fixes oss-fuzz#13691.

src/nspawn/nspawn-mount.c

index 12f557e..4878586 100644 (file)
@@ -304,7 +304,7 @@ int overlay_mount_parse(CustomMount **l, size_t *n, const char *s, bool read_onl
                 /* If the upper directory is unspecified, then let's create it automatically as a throw-away directory
                  * in /var/tmp */
                 if (isempty(upper))
-                        upper = NULL;
+                        upper = mfree(upper);
                 else if (!source_path_is_valid(upper))
                         return -EINVAL;