virshEventPrint: Use automatic memory clearing

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-01-27 13:54:57 +01:00
parent 8500571466
commit bf9de8cb51

View File

@ -13166,13 +13166,13 @@ static void
virshEventPrint(virshDomEventData *data,
virBuffer *buf)
{
char *msg;
g_autofree char *msg = NULL;
if (!(msg = virBufferContentAndReset(buf)))
return;
if (!data->loop && *data->count)
goto cleanup;
return;
if (data->timestamp) {
char timestamp[VIR_TIME_STRING_BUFLEN];
@ -13188,9 +13188,6 @@ virshEventPrint(virshDomEventData *data,
(*data->count)++;
if (!data->loop)
vshEventDone(data->ctl);
cleanup:
VIR_FREE(msg);
}
static void