From: Barrett Schonefeld <bschoney(a)utexas.edu>
- src/util/virlog.c
Signed-off-by: Barrett Schonefeld <bschoney(a)utexas.edu>
---
src/util/virlog.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/util/virlog.c b/src/util/virlog.c
index 6b7a4512e9..e12fd58831 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -505,8 +505,8 @@ virLogVMessage(virLogSourcePtr source,
va_list vargs)
{
static bool logInitMessageStderr = true;
- char *str = NULL;
- char *msg = NULL;
+ g_autofree char *str = NULL;
+ g_autofree char *msg = NULL;
char timestamp[VIR_TIME_STRING_BUFLEN];
size_t i;
int saved_errno = errno;
@@ -601,10 +601,7 @@ virLogVMessage(virLogSourcePtr source,
str, msg, (void *) STDERR_FILENO);
}
virLogUnlock();
-
cleanup:
- VIR_FREE(str);
- VIR_FREE(msg);
errno = saved_errno;
}
--
2.29.0