From 30ca9a975efbb6d1bd140719fbf00de4c993cc9a Mon Sep 17 00:00:00 2001 From: Jaap Keuter Date: Thu, 5 Nov 2020 10:47:10 +0000 Subject: [PATCH] giop: don't use packet scope for allocating a buffer at init time Followup on commit 2c2ee172eb1eadda5a418558fe35d2e3e2c03317 Also when reading in lines from the file don't use packet scope. Fixes #16984 (cherry picked from commit 40ce72f1a8cfbc9df1fd0dd637f2b8f00b4f5042) --- epan/dissectors/packet-giop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c index 96b9a5427f..60bfa3bb1b 100644 --- a/epan/dissectors/packet-giop.c +++ b/epan/dissectors/packet-giop.c @@ -1465,7 +1465,7 @@ static guint32 string_to_IOR(gchar *in, guint32 in_len, guint8 **out) { gint8 tmpval; /* complete value */ guint32 i; - *out = wmem_alloc0_array(wmem_packet_scope(), guint8, in_len); /* allocate buffer */ + *out = wmem_alloc0_array(NULL, guint8, in_len); /* allocate buffer */ if (*out == NULL) { return 0; @@ -1528,7 +1528,7 @@ static void read_IOR_strings_from_file(const gchar *name, int max_iorlen) { int len; int ior_val_len; /* length after unstringifying. */ FILE *fp; - guint8 *out; /* ptr to unstringified IOR */ + guint8 *out = NULL; /* ptr to unstringified IOR */ tvbuff_t *tvb; /* temp tvbuff for dissectin IORs */ int my_offset = 0; gboolean stream_is_big_endian; @@ -1571,6 +1571,7 @@ static void read_IOR_strings_from_file(const gchar *name, int max_iorlen) { fclose(fp); /* be nice */ wmem_free(NULL, buf); + wmem_free(NULL, out); }