mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-06 20:00:05 +00:00
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:
parent
8500571466
commit
bf9de8cb51
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user