aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.h
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-10 14:25:59 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-10 14:25:59 +0000
commit39b6747dff04f909a97ab5b38d4862ec8518e590 (patch)
treebd6dc25e40e463e67fe7b295e144b027909a62cc /epan/tvbuff.h
parent2f2a6deb47c831a141639966873a3a81e6adcaa4 (diff)
add new function tvb_get_ephemeral_stringz()
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15273 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r--epan/tvbuff.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h
index d76f9b2395..29504ebd5f 100644
--- a/epan/tvbuff.h
+++ b/epan/tvbuff.h
@@ -444,8 +444,17 @@ extern guint8 *tvb_get_ephemeral_string(tvbuff_t *tvb, gint offset, gint length)
* a buffer big enough to hold the string, copy the string into it,
* and return a pointer to the string. Also return the length of the
* string (including the terminating null) through a pointer.
+ *
+ * tvb_get_stringz() returns a string allocated by g_malloc() and therefore
+ * MUST be g_free() by the caller in order not to leak
+ * memory.
+ *
+ * tvb_get_ephemeral_stringz() returns a string that does not need to be freed,
+ * instead it will automatically be freed once the next
+ * packet is dissected.
*/
extern guint8 *tvb_get_stringz(tvbuff_t *tvb, gint offset, gint *lengthp);
+extern guint8 *tvb_get_ephemeral_stringz(tvbuff_t *tvb, gint offset, gint *lengthp);
/** Looks for a stringz (NUL-terminated string) in tvbuff and copies
* no more than bufsize number of bytes, including terminating NUL, to buffer.