Skip to content

Commit

Permalink
coverity: #1435263
Browse files Browse the repository at this point in the history
Use after free

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed May 12, 2018
1 parent 92fff0e commit f530c8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lxc/lxccontainer.c
Expand Up @@ -1634,11 +1634,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");
Expand Down

0 comments on commit f530c8c

Please sign in to comment.