From: Shukui Yang Date: Fri, 11 Aug 2017 09:12:24 +0000 (+0800) Subject: Fix mem leak with realpath X-Git-Tag: lxc-2.1.0~24^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1739%2Fhead;p=thirdparty%2Flxc.git Fix mem leak with realpath Signed-off-by: Shukui Yang --- diff --git a/src/lxc/tools/lxc_start.c b/src/lxc/tools/lxc_start.c index ef45ffb08..20d5b0364 100644 --- a/src/lxc/tools/lxc_start.c +++ b/src/lxc/tools/lxc_start.c @@ -80,16 +80,11 @@ static int ensure_path(char **confpath, const char *path) goto err; } - *confpath = strdup(fullpath); - if (!*confpath) { - ERROR("failed to dup string '%s'", fullpath); - goto err; - } + *confpath = fullpath; } err = EXIT_SUCCESS; err: - free(fullpath); return err; }