aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ldap.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-06-20 06:26:03 +0000
committerEvan Huus <eapache@gmail.com>2013-06-20 06:26:03 +0000
commitd63bd5330ffa0a57bf1dfda6ad636abc43814cee (patch)
tree7de5b2c91ef587711041da946024b044a4cb145d /epan/dissectors/packet-ldap.c
parent4c506222d92a01bf6cb2481993577d979c4cc25c (diff)
Back out some of the wmem conversions (r50063 and r50057).
These dissectors allocate ephemeral or seasonal memory in UAT callbacks, which really makes no sense because UAT callbacks can occur when there is no packet or file in scope, making this effectively a leak if the user is fiddling with their UAT and never opens a capture. Emem let you get away with this, wmem forces an assertion. Back out the changes so that the UATs are usable until the code can be properly fixed to not use out-of-scope allocators. svn path=/trunk/; revision=50073
Diffstat (limited to 'epan/dissectors/packet-ldap.c')
-rw-r--r--epan/dissectors/packet-ldap.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index c5e2b92723..25feb92308 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -101,7 +101,7 @@
#include <epan/conversation.h>
#include <epan/prefs.h>
#include <epan/tap.h>
-#include <epan/wmem/wmem.h>
+#include <epan/emem.h>
#include <epan/oids.h>
#include <epan/strutil.h>
#include <epan/show_exception.h>
@@ -627,13 +627,13 @@ attribute_types_update_cb(void *r, const char **err)
char c;
if (rec->attribute_type == NULL) {
- *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty");
+ *err = ep_strdup_printf("Attribute type can't be empty");
return;
}
g_strstrip(rec->attribute_type);
if (rec->attribute_type[0] == 0) {
- *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty");
+ *err = ep_strdup_printf("Attribute type can't be empty");
return;
}
@@ -642,7 +642,7 @@ attribute_types_update_cb(void *r, const char **err)
*/
c = proto_check_field_name(rec->attribute_type);
if (c) {
- *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't contain '%c'", c);
+ *err = ep_strdup_printf("Attribute type can't contain '%c'", c);
return;
}
@@ -853,7 +853,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as
/* This octet string contained a GUID */
dissect_dcerpc_uuid_t(tvb, offset, actx->pinfo, tree, drep, hf_ldap_guid, &uuid);
- ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024);
+ ldapvalue_string=(char*)ep_alloc(1024);
g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
uuid.Data1, uuid.Data2, uuid.Data3,
uuid.Data4[0], uuid.Data4[1],
@@ -869,7 +869,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as
/* get flag value to populate ldapvalue_string */
flags=tvb_get_letohl(tvb, offset);
- ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024);
+ ldapvalue_string=(char*)ep_alloc(1024);
g_snprintf(ldapvalue_string, 1023, "0x%08x",flags);
/* populate bitmask subtree */
@@ -903,9 +903,9 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as
/* convert the string into a printable string */
if(is_ascii){
- ldapvalue_string=wmem_strndup(wmem_packet_scope(), str, len);
+ ldapvalue_string=ep_strndup(str, len);
} else {
- ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 3*len);
+ ldapvalue_string=(char*)ep_alloc(3*len);
for(i=0;i<len;i++){
g_snprintf(ldapvalue_string+i*3,3,"%02x",str[i]&0xff);
ldapvalue_string[3*i+2]=':';
@@ -1032,7 +1032,7 @@ ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu
}
/* if we cant reuse the old one, grab a new chunk */
if(!lcrp){
- lcrp=wmem_new(wmem_file_scope(), ldap_call_response_t);
+ lcrp=se_new(ldap_call_response_t);
}
lcrp->messageId=messageId;
lcrp->req_frame=pinfo->fd->num;
@@ -4741,7 +4741,7 @@ dissect_ldap_guid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* This octet string contained a GUID */
dissect_dcerpc_uuid_t(tvb, 0, pinfo, tree, drep, hf_ldap_guid, &uuid);
- ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024);
+ ldapvalue_string=(char*)ep_alloc(1024);
g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
uuid.Data1, uuid.Data2, uuid.Data3,
uuid.Data4[0], uuid.Data4[1],