diff --git a/epan/dissectors/packet-afs.c b/epan/dissectors/packet-afs.c index 28e4d33431..9e85420c0c 100644 --- a/epan/dissectors/packet-afs.c +++ b/epan/dissectors/packet-afs.c @@ -545,18 +545,23 @@ static void OUT_RXString(ptvcursor_t *cursor, int field) static void OUT_RXStringV(ptvcursor_t *cursor, int field, guint32 length) { tvbuff_t* tvb = ptvcursor_tvbuff(cursor); - char* str = (char*)wmem_alloc(wmem_packet_scope(), length+1); + wmem_strbuf_t *strbuf = wmem_strbuf_sized_new(wmem_packet_scope(), length+1, 0); int offset = ptvcursor_current_offset(cursor), start_offset = offset; guint32 idx; for (idx = 0; idx