mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
libxl: Fix memory leak if pthread_create fails.
If we fail to create the thread we leak the shutdown_info structure. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
parent
fc7b23db02
commit
95003cd511
@ -473,7 +473,7 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
|
||||
libxlDriverPrivatePtr driver = data;
|
||||
virDomainObjPtr vm = NULL;
|
||||
libxl_shutdown_reason xl_reason = event->u.domain_shutdown.shutdown_reason;
|
||||
struct libxlShutdownThreadInfo *shutdown_info;
|
||||
struct libxlShutdownThreadInfo *shutdown_info = NULL;
|
||||
virThread thread;
|
||||
libxlDriverConfigPtr cfg;
|
||||
|
||||
@ -526,6 +526,7 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
|
||||
virObjectUnref(cfg);
|
||||
if (vm)
|
||||
virObjectUnlock(vm);
|
||||
VIR_FREE(shutdown_info);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user