ソースを参照

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;
 	}