Преглед изворни кода

correct fd leak on error case

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1229 fd59a12c-fef9-0310-b244-a6a79926bd2f
Fabien Thomas пре 19 година
родитељ
комит
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 */
 /* if I comment out the 4 lines below the executive crashes */
 	callbackFD = socket (PF_UNIX, SOCK_STREAM, 0);
 	callbackFD = socket (PF_UNIX, SOCK_STREAM, 0);
 	if (callbackFD == -1) {
 	if (callbackFD == -1) {
+		close (responseFD);
 		return (SA_AIS_ERR_NO_RESOURCES);
 		return (SA_AIS_ERR_NO_RESOURCES);
 	}
 	}