From: Christian Brauner Date: Mon, 30 Apr 2018 10:18:23 +0000 (+0200) Subject: coverity: #1435263 X-Git-Tag: lxc-2.0.10~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=853026fb799e1d75b44ce86201deb8ae969c3393;p=thirdparty%2Flxc.git coverity: #1435263 Use after free Signed-off-by: Christian Brauner --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 8356d8d2c..478c7924b 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1534,11 +1534,12 @@ static bool prepend_lxc_header(char *path, const char *t, char *const argv[]) } ret = sha1sum_file(tpath, md_value); - free(tpath); if (ret < 0) { ERROR("Failed to get sha1sum of %s", tpath); + free(tpath); goto out_free_contents; } + free(tpath); #endif f = fopen(path, "w");