diff options
author | Evan Huus <eapache@gmail.com> | 2013-02-08 17:09:18 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-02-08 17:09:18 +0000 |
commit | 8c8533e0dd4223ce423896dfb3c089c037d83686 (patch) | |
tree | 779f2f4cb7e1fd68aee969dcccf0a7165e2346b4 /epan/wmem/wmem_strbuf.c | |
parent | d6af95490a6e01fed7b6de208f964dbebb4739e8 (diff) |
Use the new realloc API when growing a string-buffer.
svn path=/trunk/; revision=47571
Diffstat (limited to 'epan/wmem/wmem_strbuf.c')
-rw-r--r-- | epan/wmem/wmem_strbuf.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/epan/wmem/wmem_strbuf.c b/epan/wmem/wmem_strbuf.c index edb0a601fe..b0dff00bcd 100644 --- a/epan/wmem/wmem_strbuf.c +++ b/epan/wmem/wmem_strbuf.c @@ -101,7 +101,6 @@ static void wmem_strbuf_grow(wmem_strbuf_t *strbuf, const gsize to_add) { gsize new_alloc_len, new_len; - gchar *new_str; new_alloc_len = strbuf->alloc_len; new_len = strbuf->len + to_add; @@ -120,11 +119,8 @@ wmem_strbuf_grow(wmem_strbuf_t *strbuf, const gsize to_add) return; } - new_str = wmem_alloc(strbuf->allocator, new_alloc_len); + strbuf->str = wmem_realloc(strbuf->allocator, strbuf->str, new_alloc_len); - g_strlcpy(new_str, strbuf->str, new_alloc_len); - - strbuf->str = new_str; strbuf->alloc_len = new_alloc_len; } |