فهرست منبع

fix: close descriptor if failed to attach stream

David Marec 1 هفته پیش
والد
کامیت
520ae25c11
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      kqueue/kq_timer.c

+ 2 - 1
kqueue/kq_timer.c

@@ -103,7 +103,8 @@ int main(int argc, char *argv[])
 
 	fd = fdopen(fdx, "w");
 	if (fd == NULL) {
-		warn("fopen() failure");
+		warn("fdopen() failure");
+		close(fdx);
 		return EXIT_FAILURE;
 	}