From e530c899406d2212fb7cb8821d083fb4871ff718 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sun, 11 Jan 2015 19:48:54 -0500 Subject: Replace se alloced memory in compare stat tap. Also replaced comments mentioning se_alloc memory with wmem_file_scope, since it's more accurate. It seems that many of the TShark stat taps may be leaking memory, because the hash tables created by the taps don't get a chance to be freed. Somewhat academic since TShark exits shortly after displaying any stats, but a leak none the less. Change-Id: I8ceecbd00d65b3442dc02d720b39c2e15aa0c8a6 Reviewed-on: https://code.wireshark.org/review/6557 Reviewed-by: Evan Huus Reviewed-by: Michael Mann --- epan/addr_resolv.h | 2 +- epan/dissectors/packet-dcom.c | 2 +- epan/dissectors/packet-giop.c | 6 +++--- epan/dissectors/packet-rtp.h | 6 +++--- epan/dissectors/packet-ssl-utils.h | 2 +- epan/next_tvb.h | 2 +- epan/oids.h | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'epan') diff --git a/epan/addr_resolv.h b/epan/addr_resolv.h index 3ba002df5c..184462c285 100644 --- a/epan/addr_resolv.h +++ b/epan/addr_resolv.h @@ -26,7 +26,7 @@ * However, take into account that when the packet dissection * completes, these buffers will be automatically reclaimed/freed. * If you need the buffer to remain for a longer scope than packet lifetime - * you must copy the content to an se_alloc() buffer. + * you must copy the content to an wmem_file_scope() buffer. */ #ifndef __RESOLV_H__ diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c index 6da11e5288..832e8ecb16 100644 --- a/epan/dissectors/packet-dcom.c +++ b/epan/dissectors/packet-dcom.c @@ -2188,7 +2188,7 @@ static void dcom_reinit( void) { dcom_machines = NULL; } - /* The data in dcom_interfaces is se_alloc'd so there's no need to free + /* The data in dcom_interfaces is wmem_file_scoped so there's no need to free * the data pointers. */ if (dcom_interfaces != NULL) { diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c index 8012a5f7a6..c5866052c4 100644 --- a/epan/dissectors/packet-giop.c +++ b/epan/dissectors/packet-giop.c @@ -1540,7 +1540,7 @@ static void giop_init(void) { /* * Create objkey/repoid hash, use my "equal" and "hash" functions. - * Note: keys and values are se_alloc'd so they don't need to be freed. + * Note: keys and values are wmem_file_scoped so they don't need to be freed. * */ @@ -1557,7 +1557,7 @@ static void giop_init(void) { /* * Create complete_reply_hash, use my "equal" and "hash" functions. - * Note: keys and values are se_alloc'd so they don't need to be freed. + * Note: keys and values are wmem_file_scoped so they don't need to be freed. * */ @@ -1574,7 +1574,7 @@ static void giop_init(void) { /* * Free giop_complete_request_list (if necessary) - * Note: The data elements are se_alloc'd so only the + * Note: The data elements are wmem_file_scoped so only the * actual list elements need to be freed. */ diff --git a/epan/dissectors/packet-rtp.h b/epan/dissectors/packet-rtp.h index db60be435e..b1a421fdab 100644 --- a/epan/dissectors/packet-rtp.h +++ b/epan/dissectors/packet-rtp.h @@ -75,8 +75,8 @@ struct _rtp_info { #if 0 /* these are only needed once the dissector include the crypto functions to decrypt and/or authenticate */ struct srtp_key_info { - guint8 *master_key; /* pointer to an se_alloc'ed master key */ - guint8 *master_salt; /* pointer to an se_alloc'ed salt for this master key - NULL if no salt */ + guint8 *master_key; /* pointer to an wmem_file_scope'ed master key */ + guint8 *master_salt; /* pointer to an wmem_file_scope'ed salt for this master key - NULL if no salt */ guint8 key_generation_rate; /* encoded as the power of 2, 0..24, or 255 (=zero rate) */ /* Either the MKI value is used (in which case from=to=0), or the values are used (and MKI=0) */ guint32 from_roc; /* 32 MSBs of a 48 bit value - frame from which this key is valid (roll-over counter part) */ @@ -94,7 +94,7 @@ struct srtp_info guint mki_len; /* number of octets used for the MKI in the RTP payload */ guint auth_tag_len; /* number of octets used for the Auth Tag in the RTP payload */ #if 0 /* these are only needed once the dissector include the crypto functions to decrypt and/or authenticate */ - struct srtp_key_info **master_keys; /* an array of pointers to master keys and their info, the array and each key struct being se_alloc'ed */ + struct srtp_key_info **master_keys; /* an array of pointers to master keys and their info, the array and each key struct being wmem_file_scope'ed */ void *enc_alg_info, /* algorithm-dependent info struct - may be void for default alg with default params */ void *auth_alg_info /* algorithm-dependent info struct - void for default alg with default params */ #endif diff --git a/epan/dissectors/packet-ssl-utils.h b/epan/dissectors/packet-ssl-utils.h index eefe6df722..a74f3b911c 100644 --- a/epan/dissectors/packet-ssl-utils.h +++ b/epan/dissectors/packet-ssl-utils.h @@ -540,7 +540,7 @@ extern guint ssl_private_key_hash (gconstpointer v); /* private key table entries have a scope 'larger' then packet capture, - * so we can't relay on se_alloc** function */ + * so we can't rely on wmem_file_scope function */ extern void ssl_private_key_free(gpointer id, gpointer key, gpointer dummy _U_); diff --git a/epan/next_tvb.h b/epan/next_tvb.h index 6fc5e72842..73679a65be 100644 --- a/epan/next_tvb.h +++ b/epan/next_tvb.h @@ -24,7 +24,7 @@ * However, take into account that when the packet dissection * completes, these buffers will be automatically reclaimed/freed. * If you need the buffer to remain for a longer scope than packet lifetime - * you must copy the content to an se_alloc() buffer. + * you must copy the content to an wmem_file_scope() buffer. */ #ifndef __NEXT_TVB_H__ diff --git a/epan/oids.h b/epan/oids.h index a0668a5272..4ddba2bd23 100644 --- a/epan/oids.h +++ b/epan/oids.h @@ -124,7 +124,7 @@ WS_DLL_PUBLIC void oids_cleanup(void); * However, take into account that when the packet dissection * completes, these buffers will be automatically reclaimed/freed. * If you need the buffer to remain for a longer scope than packet lifetime - * you must copy the content to an se_alloc() buffer. + * you must copy the content to an wmem_file_scope() buffer. */ /* -- cgit v1.2.3