aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-01-19 20:14:42 +0000
committerEvan Huus <eapache@gmail.com>2013-01-19 20:14:42 +0000
commit518eee193b6625b8ebd378afa7fa3749576a51f3 (patch)
tree4e737dfc550cf517d6c69b55cbd413e464e6aa97 /asn1
parent669b98bb5ff1bf84fdf4cf8e75542902bc8463b3 (diff)
Use epan-scoped memory to clean up another 1Kb+ of valgrind
sorta-false-positive leaks. svn path=/trunk/; revision=47170
Diffstat (limited to 'asn1')
-rw-r--r--asn1/h248/packet-h248-template.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c
index c53a460a7e..553035e137 100644
--- a/asn1/h248/packet-h248-template.c
+++ b/asn1/h248/packet-h248-template.c
@@ -29,6 +29,7 @@
#include "packet-h248.h"
#include <epan/tap.h>
+#include <epan/wmem/wmem.h>
#include "packet-tpkt.h"
#include <ctype.h>
#include "packet-mtp3.h"
@@ -911,7 +912,7 @@ void h248_register_package(const h248_package_t* pkg, pkg_reg_action reg_action)
while (base_package_name_vals[i].strptr != NULL) {
pkg_found = g_new0(h248_package_t, 1); /* create a h248 package structure */
pkg_found->id = base_package_name_vals[i].value;
- vst = g_new0(value_string,2);
+ vst = wmem_alloc0(wmem_epan_scope(), sizeof(value_string)*2);
vst[0].strptr = base_package_name_vals[i].strptr;
pkg_found->param_names = vst;
pkg_found->hfid = &hf_h248_pkg_name;
@@ -924,7 +925,7 @@ void h248_register_package(const h248_package_t* pkg, pkg_reg_action reg_action)
j++;
};
if (idx < j) {
- vst = g_new0(value_string,j-idx+1);
+ vst = wmem_alloc0(wmem_epan_scope(), sizeof(value_string)*(j-idx+1));
for (k=0;idx<j;k++) {
vst[k].strptr = base_event_name_vals[idx].strptr;
vst[k].value = (base_event_name_vals[idx].value & 0xffff);
@@ -948,7 +949,7 @@ void h248_register_package(const h248_package_t* pkg, pkg_reg_action reg_action)
pkg_found->signal_names = vst;
}
};
- s_pkg = g_new0(s_h248_package_t,1);
+ s_pkg = wmem_new0(wmem_epan_scope(), s_h248_package_t);
s_pkg->is_default = TRUE;
s_pkg->pkg = pkg_found;
g_tree_insert(packages, GINT_TO_POINTER(pkg_found->id), (gpointer)s_pkg);