diff options
author | Evan Huus <eapache@gmail.com> | 2013-06-20 23:27:16 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-06-20 23:27:16 +0000 |
commit | 3258f1297e9ee49ef0b2776db9999775f611b9e2 (patch) | |
tree | b3ad3c4950f766147353ee8015c2f910df4040bd /epan/dissectors/packet-dcom-sysact.c | |
parent | 3307acc35f9b288f243a78685a4d1421fa83671f (diff) |
Save and restore private_data pointer instead of freeing the old one, since this
function can be called nestedly. Also use wmem memory so it doesn't leak.
Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8828
svn path=/trunk/; revision=50094
Diffstat (limited to 'epan/dissectors/packet-dcom-sysact.c')
-rw-r--r-- | epan/dissectors/packet-dcom-sysact.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/epan/dissectors/packet-dcom-sysact.c b/epan/dissectors/packet-dcom-sysact.c index b8b699d1b1..7e156dc5aa 100644 --- a/epan/dissectors/packet-dcom-sysact.c +++ b/epan/dissectors/packet-dcom-sysact.c @@ -28,6 +28,7 @@ #include <glib.h> #include <epan/packet.h> +#include <epan/wmem/wmem.h> #include "packet-dcerpc.h" #include "packet-dcom.h" @@ -394,6 +395,7 @@ dissect_dcom_ActivationProperties(tvbuff_t *tvb, gint offset, packet_info *pinfo dcerpc_info *di; proto_item *sub_item; proto_tree *sub_tree; + property_guids_t *old_pg = NULL; guint32 u32TotalSize; guint32 u32Res; @@ -407,16 +409,13 @@ dissect_dcom_ActivationProperties(tvbuff_t *tvb, gint offset, packet_info *pinfo hf_sysact_res, &u32Res); di = (dcerpc_info *)pinfo->private_data; - if (di->private_data) { - g_free(di->private_data); - } - di->private_data = g_new(property_guids_t,1); - memset(di->private_data, 0, sizeof(property_guids_t)); + old_pg = (property_guids_t*)di->private_data; + di->private_data = wmem_new0(wmem_packet_scope(), property_guids_t); offset = dissect_dcom_ActivationPropertiesCustomerHdr(tvb, offset, pinfo, sub_tree, drep); offset = dissect_dcom_ActivationPropertiesBody(tvb, offset, pinfo, sub_tree, drep); - g_free(di->private_data); + di->private_data = old_pg; return offset; } |