提交 c5c0dc3c 编写于 作者: P Peter Krempa

virTPMEmulatorInit: Don't use temporary variable to free path

Use VIR_FREE directly.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
上级 473c54e7
......@@ -290,7 +290,6 @@ virTPMEmulatorInit(void)
g_autofree char *path = NULL;
bool findit = *prgs[i].path == NULL;
struct stat statbuf;
char *tmp;
if (!findit) {
/* has executables changed? */
......@@ -303,9 +302,7 @@ virTPMEmulatorInit(void)
}
if (findit) {
tmp = *prgs[i].path;
VIR_FREE(tmp);
*prgs[i].path = NULL;
VIR_FREE(*prgs[i].path);
path = virFindFileInPath(prgs[i].name);
if (!path) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册