瀏覽代碼

correct fd leak on error case

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1229 fd59a12c-fef9-0310-b244-a6a79926bd2f
Fabien Thomas 20 年之前
父節點
當前提交
76bffbc3e4
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lib/util.c

+ 1 - 0
lib/util.c

@@ -170,6 +170,7 @@ saServiceConnect (
 /* if I comment out the 4 lines below the executive crashes */
 	callbackFD = socket (PF_UNIX, SOCK_STREAM, 0);
 	if (callbackFD == -1) {
+		close (responseFD);
 		return (SA_AIS_ERR_NO_RESOURCES);
 	}