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>
This commit is contained in:
AndersBroman 2014-06-05 13:23:14 +02:00 committed by Anders Broman
parent 6db547f8bf
commit 52349721d5
1 changed files with 7 additions and 4 deletions

View File

@ -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;