virTPMEmulatorInit: Don't use temporary variable to free path

Use VIR_FREE directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com
This commit is contained in:
Peter Krempa 2020-06-11 10:26:19 +02:00
parent 473c54e788
commit c5c0dc3c81

View File

@ -290,7 +290,6 @@ virTPMEmulatorInit(void)
g_autofree char *path = NULL; g_autofree char *path = NULL;
bool findit = *prgs[i].path == NULL; bool findit = *prgs[i].path == NULL;
struct stat statbuf; struct stat statbuf;
char *tmp;
if (!findit) { if (!findit) {
/* has executables changed? */ /* has executables changed? */
@ -303,9 +302,7 @@ virTPMEmulatorInit(void)
} }
if (findit) { if (findit) {
tmp = *prgs[i].path; VIR_FREE(*prgs[i].path);
VIR_FREE(tmp);
*prgs[i].path = NULL;
path = virFindFileInPath(prgs[i].name); path = virFindFileInPath(prgs[i].name);
if (!path) { if (!path) {