aboutsummaryrefslogtreecommitdiff
path: root/value.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-10-30 00:26:21 +0100
committerPetr Machata <pmachata@redhat.com>2012-10-30 00:26:21 +0100
commit635786d16da4cb3665ceb82bdb000331c9a8febd (patch)
treefe6c29635474ede696e6276a73a185508c6d27bc /value.c
parentbc58f2a1b2b516b2176a4a32117065dde4813734 (diff)
downloadltrace-635786d16da4cb3665ceb82bdb000331c9a8febd.tar.gz
Also free memory associated with value type, if owned
This plugs a leak.
Diffstat (limited to 'value.c')
-rw-r--r--value.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/value.c b/value.c
index 82cf171..734fc3b 100644
--- a/value.c
+++ b/value.c
@@ -60,8 +60,10 @@ value_init_detached(struct value *valp, struct value *parent,
void
value_set_type(struct value *value, struct arg_type_info *type, int own_type)
{
- if (value->own_type)
+ if (value->own_type) {
type_destroy(value->type);
+ free(value->type);
+ }
value->type = type;
value->own_type = own_type;
}