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>
This commit is contained in:
Peter Wu 2017-04-19 01:40:25 +02:00 committed by Michael Mann
parent cfab5ef035
commit 84e7855f27
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}
}