[torqueusers] Possible oversite in torque_gssapi
Mike Coyne
Mike.Coyne at PACCAR.com
Tue Nov 24 12:47:48 MST 2009
In building the gassapi version ot torque from the svn archive I ran
across a memory leak in pbs_mom after running valgrind
It would appear the buffers allocated int the DIS_tcp_setup() didn't get
seem to be free'd when the
DIS_tcp_release() was called so I proposed adding the following...
This may have resulted from a bad job incorporating the latest update in
svn to my local build but I though I would ask the group if this is the
right place to free the buffers?
Index: /trunk/torque_gss/src/lib/Libifl/tcp_dis.c
===================================================================
--- /trunk/torque_gss/src/lib/Libifl/tcp_dis.c (revision 534)
+++ /trunk/torque_gss/src/lib/Libifl/tcp_dis.c (revision 538)
@@ -1075,16 +1075,28 @@
#ifdef GSSAPI
OM_uint32 minor;
#endif
+ struct tcp_chan *tcp;
+ struct tcpdisbuf *tp;
+
assert (fd >= 0);
if (fd >= tcparraymax || tcparray[fd] == NULL)
return; /* Might be an RPP connection */
+
+ tcp=tcparray[fd];
+ tp = &tcp->readbuf;
+ if (tp->tdis_thebuf != NULL) free(tp->tdis_thebuf);
+ tp = &tcp->writebuf;
+ if (tp->tdis_thebuf != NULL) free(tp->tdis_thebuf);
#ifdef GSSAPI
if (tcparray[fd]->gssctx != GSS_C_NO_CONTEXT)
gss_delete_sec_context (&minor, &tcparray[fd]->gssctx,
GSS_C_NO_BUFFER);
if (tcparray[fd]->unwrapped.value)
gss_release_buffer (&minor, &tcparray[fd]->unwrapped);
+ /*fix memory loss in DIS_scp_setup */
+ tp = &tcp->gssrdbuf;
+ if (tp->tdis_thebuf != NULL) free(tp->tdis_thebuf);
#endif
free(tcparray[fd]);
tcparray[fd] = NULL;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.supercluster.org/pipermail/torqueusers/attachments/20091124/7a09b7f8/attachment-0001.html
More information about the torqueusers
mailing list