commit | ec285cd6053f72136e940ba97f6f154c0df1319e | [log] [tgz] |
---|---|---|
author | Juraj Vijtiuk <juraj.vijtiuk@sartura.hr> | Thu Jan 14 11:41:20 2021 +0100 |
committer | Radek Krejci <rkrejci@cesnet.cz> | Mon Jan 18 14:14:36 2021 +0100 |
tree | 3f7440fb4869b35a464b948a24917a97b7067887 | |
parent | 257bdcf38fa477f4d08b7f3914bdcd04c4d0abb9 [diff] [blame] |
json BUGFIX invalid free in lyjson_ctx_set_value Check whether the previous jsonctx->value was dynamic when freeing it, instead of checking whether the one that is currently being set is dynamic.
diff --git a/src/json.c b/src/json.c index ffe322f..95c5bda 100644 --- a/src/json.c +++ b/src/json.c
@@ -91,7 +91,7 @@ { assert(jsonctx); - if (dynamic) { + if (jsonctx->dynamic) { free((char *)jsonctx->value); } jsonctx->value = value;