summaryrefslogtreecommitdiff
path: root/epan/frame_data.c
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2014-06-05 13:23:14 +0200
committerAnders Broman <a.broman58@gmail.com>2014-06-05 11:26:33 +0000
commit52349721d56c81dc4c7e9fe3b7a15c5429977edd (patch)
treea57c13f8ac9916c8cf692598ea8dea0c521c2e3c /epan/frame_data.c
parent6db547f8bf09891e3afc1a3da918d7a11dc9a4aa (diff)
downloadwireshark-52349721d56c81dc4c7e9fe3b7a15c5429977edd.tar.gz
Make socpe a local variable, can be used if we change the g_slist to a
wmem_list. Change-Id: I176a2acc5ae334916978f543c959287bf0d8541e Reviewed-on: https://code.wireshark.org/review/1979 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/frame_data.c')
-rw-r--r--epan/frame_data.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/epan/frame_data.c b/epan/frame_data.c
index 5b933efc3c..ebfeb99dfe 100644
--- a/epan/frame_data.c
+++ b/epan/frame_data.c
@@ -67,19 +67,22 @@ p_compare(gconstpointer a, gconstpointer b)
}
void
-p_add_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key, void *proto_data)
+p_add_proto_data(wmem_allocator_t *tmp_scope, struct _packet_info* pinfo, int proto, guint32 key, void *proto_data)
{
frame_proto_data *p1;
GSList** proto_list;
+ wmem_allocator_t *scope;
- if (scope == pinfo->pool) {
- p1 = (frame_proto_data *)wmem_alloc(scope, sizeof(frame_proto_data));
+ if (tmp_scope == pinfo->pool) {
+ scope = tmp_scope;
proto_list = &pinfo->proto_data;
} else {
- p1 = (frame_proto_data *)wmem_alloc(wmem_file_scope(), sizeof(frame_proto_data));
+ scope = wmem_file_scope();
proto_list = &pinfo->fd->pfd;
}
+ p1 = (frame_proto_data *)wmem_alloc(scope, sizeof(frame_proto_data));
+
p1->proto = proto;
p1->key = key;
p1->proto_data = proto_data;