From 84e7855f271d7f912499ef27142cd7b4ffecf830 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 19 Apr 2017 01:40:25 +0200 Subject: [PATCH] smb-pipe: fix memory leaks from descriptors The values from the requests are used in a later response, so use the packet capture file scope instead. Bug: 13615 Change-Id: I480d9dbdc20c64eabea092065245d8687b7fc39f Reviewed-on: https://code.wireshark.org/review/21211 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-smb-pipe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c index ca16103599..3c6053cf61 100644 --- a/epan/dissectors/packet-smb-pipe.c +++ b/epan/dissectors/packet-smb-pipe.c @@ -2659,7 +2659,7 @@ dissect_pipe_lanman(tvbuff_t *pd_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb, * Save the parameter descriptor for future use. */ DISSECTOR_ASSERT(trp->param_descrip == NULL); - trp->param_descrip = g_strdup(param_descrip); + trp->param_descrip = wmem_strdup(wmem_file_scope(), param_descrip); } offset += descriptor_len; @@ -2672,7 +2672,7 @@ dissect_pipe_lanman(tvbuff_t *pd_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb, * Save the return descriptor for future use. */ DISSECTOR_ASSERT(trp->data_descrip == NULL); - trp->data_descrip = g_strdup(data_descrip); + trp->data_descrip = wmem_strdup(wmem_file_scope(), data_descrip); } offset += descriptor_len; @@ -2699,7 +2699,7 @@ dissect_pipe_lanman(tvbuff_t *pd_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb, */ DISSECTOR_ASSERT(trp->aux_data_descrip == NULL); trp->aux_data_descrip = - g_strdup(aux_data_descrip); + wmem_strdup(wmem_file_scope(), aux_data_descrip); } }