forked from osmocom/wireshark
USB HID: Fix a memory leak.
Replace mismatched g_strdup() + g_free()s with wmem_strdup_printf(wmem_packet_scope(), ...). Fixes #17124.
This commit is contained in:
parent
6a860c979a
commit
26f0db01a7
|
@ -3721,7 +3721,7 @@ get_usage_page_item_string(guint32 usage_page, guint32 id)
|
|||
if (!str)
|
||||
str = "Reserved";
|
||||
|
||||
return g_strdup_printf(str, id);
|
||||
return wmem_strdup_printf(wmem_packet_scope(), str, id);
|
||||
}
|
||||
|
||||
/* Dissector for the data in a HID main report. */
|
||||
|
@ -3946,8 +3946,6 @@ dissect_usb_hid_report_localitem_data(packet_info *pinfo _U_, proto_tree *tree,
|
|||
}
|
||||
offset += bSize;
|
||||
|
||||
g_free(str);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue