aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-08-17 08:50:04 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-08-17 08:50:04 +0000
commit68bfa7736efd474b7bcdb416165e6be4c0e6c502 (patch)
treea5aaa892de68e2a4715f4db6d1a9e9528cd3ef43 /epan
parentdb4cbf9537f2a2fa3819bd0531906fe92589b070 (diff)
replace g_malloc() with ep_alloc() for ftp and sdp
sdp never free the allocated memory so it were leaking memory for every packet containng sdp. fix memleak for sdp svn path=/trunk/; revision=15381
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ftp.c4
-rw-r--r--epan/dissectors/packet-sdp.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c
index a998940625..6140340fef 100644
--- a/epan/dissectors/packet-ftp.c
+++ b/epan/dissectors/packet-ftp.c
@@ -39,6 +39,7 @@
#include <epan/packet.h>
#include <epan/strutil.h>
#include <epan/conversation.h>
+#include <epan/emem.h>
static int proto_ftp = -1;
static int proto_ftp_data = -1;
@@ -176,7 +177,7 @@ parse_port_pasv(const guchar *line, int linelen, guint32 *ftp_ip,
/*
* Copy the rest of the line into a null-terminated buffer.
*/
- args = g_malloc(linelen + 1);
+ args = ep_alloc(linelen + 1);
memcpy(args, line, linelen);
args[linelen] = '\0';
p = args;
@@ -219,7 +220,6 @@ parse_port_pasv(const guchar *line, int linelen, guint32 *ftp_ip,
p++;
}
- g_free(args);
return ret;
}
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index d55a996c5d..4572dd8d0f 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -56,6 +56,7 @@
#include <epan/packet.h>
#include <epan/conversation.h>
#include <epan/strutil.h>
+#include <epan/emem.h>
#include "tap.h"
#include "packet-sdp.h"
@@ -72,7 +73,6 @@ static dissector_handle_t rtcp_handle=NULL;
static dissector_handle_t t38_handle=NULL;
static int sdp_tap = -1;
-static sdp_packet_info *sdp_pi;
static int proto_sdp = -1;
@@ -229,9 +229,10 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean is_ipv6_addr=FALSE;
guint32 ipaddr[4];
gint n,i;
+ sdp_packet_info *sdp_pi;
/* Initialise packet info for passing to tap */
- sdp_pi = g_malloc(sizeof(sdp_packet_info));
+ sdp_pi = ep_alloc(sizeof(sdp_packet_info));
sdp_pi->summary_str[0] = '\0';
/* Initialise RTP channel info */