[PATCH] driver: Don't leak saved error in virGetConnectGeneric()
jtomko at jtomko.net
Mon May 17 13:17:34 UTC 2021
On a Monday in 2021, Michal Privoznik wrote:
>Recently, a new code was added to virGetConnectGeneric() that
>saves the original error into a variable so that it's not lost in
>virConnectClose() called under the 'error' label.
>However, the error saving code uses virSaveLastError() +
>virSetError() combo which leaks the memory allocated for the
>error copy. Using virErrorPreserveLast() + virErrorRestore() does
>the same job without the memleak.
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> src/driver.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Ján Tomko <jtomko at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 488 bytes
Desc: not available
More information about the libvir-list