aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-smb-common.c4
-rw-r--r--epan/dissectors/packet-smb-logon.c2
2 files changed, 1 insertions, 5 deletions
diff --git a/epan/dissectors/packet-smb-common.c b/epan/dissectors/packet-smb-common.c
index cb9d6fdc54..6619010ada 100644
--- a/epan/dissectors/packet-smb-common.c
+++ b/epan/dissectors/packet-smb-common.c
@@ -65,15 +65,13 @@ int display_ms_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index,
/* display a string from the tree and return the new offset */
- str = tvb_get_stringz(tvb, offset, &len);
+ str = tvb_get_ephemeral_stringz(tvb, offset, &len);
proto_tree_add_string(tree, hf_index, tvb, offset, len, str);
/* Return a copy of the string if requested */
if (data)
*data = str;
- else
- g_free(str);
return offset+len;
}
diff --git a/epan/dissectors/packet-smb-logon.c b/epan/dissectors/packet-smb-logon.c
index ffc21bdf9a..cbb54cb572 100644
--- a/epan/dissectors/packet-smb-logon.c
+++ b/epan/dissectors/packet-smb-logon.c
@@ -327,8 +327,6 @@ dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, i
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", name);
- g_free(name);
-
/* mailslot name */
offset = display_ms_string(tvb, tree, offset, hf_mailslot_name, NULL);