On 06/14/2018 08:36 AM, Richard W.M. Jones wrote:
Found by Coverity.
---
plugins/nbd/nbd.c | 2 ++
1 file changed, 2 insertions(+)
ACK.
diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c
index b9e72bc..2b5569b 100644
--- a/plugins/nbd/nbd.c
+++ b/plugins/nbd/nbd.c
@@ -465,6 +465,7 @@ nbd_open (int readonly)
h->fd = socket (AF_UNIX, SOCK_STREAM, 0);
if (h->fd < 0) {
nbdkit_error ("socket: %m");
+ free (h);
return NULL;
}
/* We already validated length during nbd_config_complete */
@@ -559,6 +560,7 @@ nbd_open (int readonly)
err:
close (h->fd);
+ free (h);
return NULL;
}
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization:
qemu.org |
libvirt.org