Found by Coverity.
---
plugins/nbd/nbd.c | 2 ++
1 file changed, 2 insertions(+)
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;
}
--
2.16.2