diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-20 20:47:48 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-20 20:47:48 +0200 |
commit | 4410e14919de62ca8af35194b8a1ecfe74c5c624 (patch) | |
tree | e0981c68093e870703af54307e0ef851f732aec4 /main.c | |
parent | 9a74b811f007986a3e6015af0c06b33147d05951 (diff) |
main: fix memory leak with -e option
Release the parsed intermediate object after copying its values into the
global env object.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -321,7 +321,9 @@ main(int argc, char **argv) env = env ? env : json_object_new_object(); json_object_object_foreach(o, key, val) - json_object_object_add(env, key, val); + json_object_object_add(env, key, json_object_get(val)); + + json_object_put(o); break; |