aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-04-19 01:40:25 +0200
committerMichael Mann <mmann78@netscape.net>2017-04-19 11:34:56 +0000
commit84e7855f271d7f912499ef27142cd7b4ffecf830 (patch)
tree9e9d87c9788d956095dbacb9c48a16f1bdfb8b8a
parentcfab5ef035db7be8502623af203ab3494a9200e3 (diff)
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 <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-smb-pipe.c6
1 files 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);
}
}