]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Bug 6097 - possible descriptor leak
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 11 Apr 2006 21:55:51 +0000 (21:55 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 11 Apr 2006 21:55:51 +0000 (21:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@19351 65c4cc65-6c06-0410-ace0-fbb531ad65f3

asterisk.c

index 40b822f69fb63573c9b677c44257754b4430854c..5e1423e8607d082d3d8cfd8a2be2ab5a050ae2d1 100644 (file)
@@ -615,6 +615,8 @@ static void *listener(void *unused)
                                        consoles[x].fd = s;
                                        if (ast_pthread_create(&consoles[x].t, &attr, netconsole, &consoles[x])) {
                                                ast_log(LOG_ERROR, "Unable to spawn thread to handle connection: %s\n", strerror(errno));
+                                               close(consoles[x].p[0]);
+                                               close(consoles[x].p[1]);
                                                consoles[x].fd = -1;
                                                fdprint(s, "Server failed to spawn thread\n");
                                                close(s);