diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-10 14:25:59 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-10 14:25:59 +0000 |
commit | 9599cf9e3b88e57f22f149c2db2956b779ba864f (patch) | |
tree | bd6dc25e40e463e67fe7b295e144b027909a62cc /epan/tvbuff.h | |
parent | efa1f430059f40d054d9f85fb0869583ffb76d2b (diff) | |
download | wireshark-9599cf9e3b88e57f22f149c2db2956b779ba864f.tar.gz |
add new function tvb_get_ephemeral_stringz()
svn path=/trunk/; revision=15273
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r-- | epan/tvbuff.h | 9 |
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. |