提交 95003cd5 编写于 作者: K Konrad Rzeszutek Wilk 提交者: Jim Fehlig

libxl: Fix memory leak if pthread_create fails.

If we fail to create the thread we leak the shutdown_info
structure.
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 fc7b23db
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册