mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
libxl: don't leak memory in libxl__poller_get failure case
Coverity-ID: 1055894
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
(cherry picked from commit 1edd6d8da3)
This commit is contained in:
1 parent
32f82fa8d9
commit
e9a0fc5998
1 file changed
+4
-1
@@ -1340,7 +1340,10 @@ libxl__poller *libxl__poller_get(libxl_ctx *ctx)
|
||||
memset(p, 0, sizeof(*p));
|
||||
|
||||
rc = libxl__poller_init(ctx, p);
|
||||
if (rc) return NULL;
|
||||
if (rc) {
|
||||
free(p);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||