torque/torque-rhbz#758740-r5270-dis-array.patch
Steve Traylen 44081f7710 Add torque-rhbz#758740-r5258-dis-close.patch and
torque-rhbz#758740-r5270-dis-array.patch
2011-11-30 19:19:35 +01:00

28 lines
728 B
Diff

Index: src/lib/Libifl/tcp_dis.c
===================================================================
--- src/lib/Libifl/tcp_dis.c (revision 5269)
+++ src/lib/Libifl/tcp_dis.c (revision 5270)
@@ -797,12 +797,19 @@
{
struct tcp_chan *tcp;
+ /* On startup tcparray may not yet be initialized. check it */
+ if (tcparray == NULL)
+ return;
+
+ if (fd > tcparraymax)
+ return;
+
tcp = tcparray[fd];
- if(tcp != NULL)
+ if (tcp != NULL)
{
- if(tcp->readbuf.tdis_thebuf != NULL)
+ if (tcp->readbuf.tdis_thebuf != NULL)
free(tcp->readbuf.tdis_thebuf);
- if(tcp->writebuf.tdis_thebuf != NULL)
+ if (tcp->writebuf.tdis_thebuf != NULL)
free(tcp->writebuf.tdis_thebuf);
free(tcp);