Commit Diff


commit - e23a5f1189bb1c81c7b6b5d2eaa9fcfc0c693fb3
commit + 5d7b9e8954738f88485c70d09f14249ebf444e3d
blob - d1d273a304568c2b659dc92d117c0efde5f1718f
blob + fb74248eaae7576ffd89d190332b3a86262f43ce
--- gotd/notify.c
+++ gotd/notify.c
@@ -452,8 +452,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);