From: Christian Brauner Date: Sat, 9 Dec 2017 19:04:46 +0000 (+0100) Subject: coverity: #1426028 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa4e165dc43bab172b941e504434a1c12bb62e7b;p=thirdparty%2Flxc.git coverity: #1426028 Signed-off-by: Christian Brauner --- diff --git a/src/lxc/storage/overlay.c b/src/lxc/storage/overlay.c index d71bc75f7..d2f3ed00c 100644 --- a/src/lxc/storage/overlay.c +++ b/src/lxc/storage/overlay.c @@ -722,15 +722,9 @@ char *ovl_get_rootfs(const char *rootfs_path, size_t *rootfslen) *s3 = '\0'; rootfsdir = strdup(s2); - if (!rootfsdir) { - free(s1); - return NULL; - } - + free(s1); if (!rootfsdir) - rootfsdir = s1; - else - free(s1); + return NULL; *rootfslen = strlen(rootfsdir);