Fix proto_tree_add_bytes_item() when we fail to decode number from string

We still need to insert an empty g_byte_array

Bug: 11309
Change-Id: Idf2ed8ea81b3f612ef8d6ae1aed158108dcc4356
Reviewed-on: https://code.wireshark.org/review/9114
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
Pascal Quantin 2015-06-24 18:04:13 -07:00
parent 585f944f65
commit 6126a64550
1 changed files with 2 additions and 0 deletions

View File

@ -2383,6 +2383,8 @@ proto_tree_add_bytes_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
if (bytes)
proto_tree_set_bytes_gbytearray(new_fi, bytes);
else
proto_tree_set_bytes(new_fi, NULL, 0);
if (created_bytes)
g_byte_array_free(created_bytes, TRUE);