Diff between f59a6d4a4e651bbd65f32eb16601f33a59927564 and 270c8d07a07815188d4359b81e00db135ff3ff63

Changed Files

File Additions Deletions Status
emulator/vhci.c +3 -1 modified

Full Patch

diff --git a/emulator/vhci.c b/emulator/vhci.c
index 59ad1ec..014df87 100644
--- a/emulator/vhci.c
+++ b/emulator/vhci.c
@@ -140,8 +140,10 @@ struct vhci *vhci_open(uint8_t type)
 	}
 
 	vhci = malloc(sizeof(*vhci));
-	if (!vhci)
+	if (!vhci) {
+		close(fd);
 		return NULL;
+	}
 
 	memset(vhci, 0, sizeof(*vhci));
 	vhci->type = type;