nspawn: fix memleak uncovered by fuzzer

This is almost the same as 0e636bf51a. I looked through the code,
and I don't see any more instances of this pattern, so hopefully this
will be the last one.

https://oss-fuzz.com/issue/5660094128193536/13691.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-03-12 17:44:01 +01:00
parent f5164dfebc
commit 6d632d00ed
2 changed files with 3 additions and 1 deletions

View 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;

View File

@ -0,0 +1,2 @@
[Files]
Overlay=/::