From: Yu Watanabe Date: Fri, 15 Mar 2019 14:53:02 +0000 (+0900) Subject: nspawn: fix memleak X-Git-Tag: v242-rc1~119^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d0c1146eaa4db5a496c43d56f8a441d0faed3d7;p=thirdparty%2Fsystemd.git nspawn: fix memleak Fixes oss-fuzz#13691. --- diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c index 12f557ee99c..4878586c4e5 100644 --- a/src/nspawn/nspawn-mount.c +++ b/src/nspawn/nspawn-mount.c @@ -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;