Commit a9fc769d authored by Gerald Combs's avatar Gerald Combs Committed by AndersBroman
Browse files

epan: Fix a memory leak.

Make sure _proto_tree_add_bits_ret_val allocates a bits array using the
packet scope, otherwise we leak memory. Fixes #17032.
parent 79f84f77
Pipeline #224358941 passed with stages
in 54 minutes and 44 seconds
......@@ -12299,7 +12299,7 @@ _proto_tree_add_bits_ret_val(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
break;
case FT_BYTES:
bytes = tvb_get_bits_array(NULL, tvb, bit_offset, no_of_bits, &bytes_length);
bytes = tvb_get_bits_array(wmem_packet_scope(), tvb, bit_offset, no_of_bits, &bytes_length);
pi = proto_tree_add_bytes_with_length(tree, hfindex, tvb, offset, length, bytes, (gint) bytes_length);
proto_item_fill_label(PITEM_FINFO(pi), lbl_str);
proto_item_set_text(pi, "%s", lbl_str);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment