diff options
author | Li, Xiaoming <lixm.fnst@cn.fujitsu.com> | 2021-01-13 15:27:09 +0800 |
---|---|---|
committer | Li Xiaoming <lixm.fnst@cn.fujitsu.com> | 2021-01-14 01:57:32 +0000 |
commit | 4f650f1d88ef43c4befc2b035275f294a3c2d43f (patch) | |
tree | 386a140f39bff16e7368fb587fe2ec78c1e1a984 /binding | |
parent | b0437544e55246ddd8f084c9c7415b3103ce285c (diff) |
Fix potential memory leakneedlefish_13.93.0needlefish/13.93.0marlin_12.93.0marlin_12.92.0marlin_12.91.0marlin_12.90.1marlin_12.90.0marlin/12.93.0marlin/12.92.0marlin/12.91.0marlin/12.90.1marlin/12.90.0lamprey_11.92.0lamprey_11.91.0lamprey/11.92.0lamprey/11.91.0koi_10.93.0koi_10.92.0koi/10.93.0koi/10.92.013.93.012.93.012.92.012.91.012.90.112.90.011.92.011.91.010.93.010.92.0
In some cases, j_query or j_array maybe unfreed after return;
Bug-AGL: SPEC-3584
Change-Id: I4bb7ff5eb51aa77d4419440701faaab8c26bc8cf
Signed-off-by: Li, Xiaoming <lixm.fnst@cn.fujitsu.com>
Diffstat (limited to 'binding')
-rw-r--r-- | binding/wrap-unicens/wrap-unicens.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/binding/wrap-unicens/wrap-unicens.c b/binding/wrap-unicens/wrap-unicens.c index 84b94cd..e27d999 100644 --- a/binding/wrap-unicens/wrap-unicens.c +++ b/binding/wrap-unicens/wrap-unicens.c @@ -154,6 +154,10 @@ extern int wrap_ucs_i2cwrite_sync(uint16_t node, uint8_t *data_ptr, uint8_t data j_array = json_object_new_array(); if(! j_query || ! j_array) { + if (j_query) + json_object_put(j_query); + if (j_array) + json_object_put(j_array); AFB_API_ERROR(api_handle_, "Failed to create writei2c json objects"); return -1; } |