From: Michal Privoznik Date: Wed, 6 Nov 2013 10:50:26 +0000 (+0100) Subject: qemuMonitorDispose: Reset lastError X-Git-Tag: v1.2.0-rc1~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cc8a5af02f09e96cd552bffbe0d7ad34a81ecae;p=thirdparty%2Flibvirt.git qemuMonitorDispose: Reset lastError Since the 90139a62 commit the error is copied into mon->lastError but it's never freed from there. ==31989== 395 bytes in 1 blocks are definitely lost in loss record 877 of 978 ==31989== at 0x4A06C2B: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==31989== by 0x7EAF129: strdup (in /lib64/libc-2.15.so) ==31989== by 0x50D586C: virStrdup (virstring.c:554) ==31989== by 0x50976C1: virCopyError (virerror.c:191) ==31989== by 0x5097A35: virCopyLastError (virerror.c:312) ==31989== by 0x114909A9: qemuMonitorIO (qemu_monitor.c:690) ==31989== by 0x509BEDE: virEventPollDispatchHandles (vireventpoll.c:501) ==31989== by 0x509C701: virEventPollRunOnce (vireventpoll.c:648) ==31989== by 0x509A620: virEventRunDefaultImpl (virevent.c:274) ==31989== by 0x520D21C: virNetServerRun (virnetserver.c:1112) ==31989== by 0x11F368: main (libvirtd.c:1513) Signed-off-by: Michal Privoznik --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 2bafe28713..0e520a0c3d 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -257,6 +257,7 @@ static void qemuMonitorDispose(void *obj) (mon->cb->destroy)(mon, mon->vm, mon->callbackOpaque); virObjectUnref(mon->vm); + virResetError(&mon->lastError); virCondDestroy(&mon->notify); VIR_FREE(mon->buffer); virJSONValueFree(mon->options);