diff options
author | Petr Machata <pmachata@redhat.com> | 2012-10-30 16:41:44 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-10-30 16:41:44 +0100 |
commit | 0d40d115a2e09bd0d432cc276d5cfc3c013468b0 (patch) | |
tree | 6f262bb1a5f36018e41bb441f3343d0d18fe4bfa /value.c | |
parent | 84c86d73716b1e785f2690918403d7094393e1f3 (diff) | |
download | ltrace-0d40d115a2e09bd0d432cc276d5cfc3c013468b0.tar.gz |
In value_reserve, first release any already-allocated memory
Diffstat (limited to 'value.c')
-rw-r--r-- | value.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -100,6 +100,8 @@ value_destroy(struct value *val) unsigned char * value_reserve(struct value *valp, size_t size) { + value_release(valp); + if (size <= sizeof(valp->u.value)) { valp->where = VAL_LOC_WORD; valp->u.value = 0; |