From 853026fb799e1d75b44ce86201deb8ae969c3393 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 30 Apr 2018 12:18:23 +0200 Subject: [PATCH] coverity: #1435263 Use after free Signed-off-by: Christian Brauner --- src/lxc/lxccontainer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"); -- 2.47.2