aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-07-16 01:57:30 +0000
committerEvan Huus <eapache@gmail.com>2013-07-16 01:57:30 +0000
commita430b138e939c7043211e1da8b75ec7464df6577 (patch)
tree51d42bb92c555c5882fdfc01ed9759f86e3e9279
parentdf77b38e6e0948ab39d7fba1d1dc890dfaf68b73 (diff)
Replace glib memory with wmem. Fixes a substantial memory leak in the TCP
dissector (potentially several megabytes for a large capture). Bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8459 svn path=/trunk/; revision=50652
-rw-r--r--epan/dissectors/packet-tcp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 74676a6918..e2817bb8ce 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -37,6 +37,7 @@
#include <epan/follow.h>
#include <epan/prefs.h>
#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/show_exception.h>
#include <epan/conversation.h>
#include <epan/reassemble.h>
@@ -1157,7 +1158,7 @@ finished_checking_retransmission_type:
nextseq = seq+seglen;
if (seglen || flags&(TH_SYN|TH_FIN)) {
/* add this new sequence number to the fwd list */
- ual = g_slice_new(tcp_unacked_t);
+ ual = wmem_new(wmem_file_scope(), tcp_unacked_t);
ual->next=tcpd->fwd->segments;
tcpd->fwd->segments=ual;
ual->frame=pinfo->fd->num;
@@ -1255,7 +1256,7 @@ finished_checking_retransmission_type:
else{
prevual->next = tmpual;
}
- g_slice_free(tcp_unacked_t, ual);
+ wmem_free(wmem_file_scope(), ual);
ual = tmpual;
}