Commit Diff


commit - e17fe79ed2af35cc59b6e45c577a715377c2e63f
commit + 28f88a8012eef7b02f7ada4a4e8a89d1d4342f70
blob - 6c4f25f2f3c6e6277708d4483155e5783e9a8b49
blob + b0a45b3e8c3fd8674394a2e9ccc32197ad110797
--- gotd/notify.c
+++ gotd/notify.c
@@ -454,8 +454,10 @@ recv_session(struct imsg *imsg)
 		return got_error(GOT_ERR_PRIVSEP_NO_FD);
 
 	session = calloc(1, sizeof(*session));
-	if (session == NULL)
+	if (session == NULL) {
+		close(fd);
 		return got_error_from_errno("calloc");
+	}
 
 	session->id = get_session_id();
 	imsg_init(&session->iev.ibuf, fd);