提交 dd0e2929 编写于 作者: J John Ferlan 提交者: Peter Krempa

conf: Fix memory leak in openvzWriteConfigParam

Since 60623a7c, @temp_file was not properly free'd on the non error path.

Found by Coverity.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 072f6d6e
......@@ -616,7 +616,7 @@ int openvzLoadDomains(struct openvz_driver *driver)
static int
openvzWriteConfigParam(const char * conf_file, const char *param, const char *value)
{
char * temp_file = NULL;
g_autofree char *temp_file = NULL;
int temp_fd = -1;
FILE *fp;
char *line = NULL;
......@@ -666,7 +666,6 @@ openvzWriteConfigParam(const char * conf_file, const char *param, const char *va
VIR_FORCE_CLOSE(temp_fd);
if (temp_file)
unlink(temp_file);
VIR_FREE(temp_file);
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册