Nano: do not use packet scope strings in columns

Bug: 14533
Change-Id: I2fcab070ca0da5a594f62bd61bd09e42e4113852
Reviewed-on: https://code.wireshark.org/review/26477
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Pascal Quantin 2018-03-14 21:14:47 +01:00 committed by Anders Broman
parent 0ebcd27377
commit 710cf8121d
1 changed files with 5 additions and 6 deletions

View File

@ -150,7 +150,7 @@ static int dissect_nano_keepalive(tvbuff_t *tvb, packet_info *pinfo, proto_tree
}
}
col_set_str(pinfo->cinfo, COL_INFO, wmem_strdup_printf(wmem_packet_scope(), "Keepalive (%d peer%s)", peers, plurality(peers, "", "s")));
col_add_fstr(pinfo->cinfo, COL_INFO, "Keepalive (%d peer%s)", peers, plurality(peers, "", "s"));
return offset;
}
@ -314,10 +314,9 @@ static int dissect_nano(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
// set the INFO header with more information
nano_block_type = (guint)((extensions >> 8) & 0xF);
col_set_str(pinfo->cinfo, COL_INFO,
wmem_strdup_printf(wmem_packet_scope(), "%s (%s)",
val_to_str(nano_packet_type, VALS(nano_packet_type_strings), " "),
val_to_str(nano_block_type, VALS(nano_block_type_strings), "Unknown (%d)")));
col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%s)",
val_to_str_const(nano_packet_type, VALS(nano_packet_type_strings), " "),
val_to_str(nano_block_type, VALS(nano_block_type_strings), "Unknown (%d)"));
// if it's a Confirm Ack packet, we first have a vote
if (nano_packet_type == NANO_PACKET_TYPE_CONFIRM_ACK) {
@ -342,7 +341,7 @@ static int dissect_nano(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
break;
default:
col_set_str(pinfo->cinfo, COL_INFO,
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(nano_packet_type, VALS(nano_packet_type_strings), "Unknown (%d)"));
}