mirror of
https://github.com/emqx/neuron.git
synced 2026-10-18 13:41:22 +08:00
Merge pull request #1807 from hxy7yx/main-1
fix(add_gtag): parser memory free
This commit is contained in:
@@ -467,17 +467,11 @@ int neu_json_decode_gtag_json(void *json_obj, neu_json_gtag_t *gtag_p)
|
||||
gtag_p->n_tag = arr.len;
|
||||
gtag_p->tags = arr.tags;
|
||||
|
||||
goto decode_exit;
|
||||
return 0;
|
||||
|
||||
decode_fail:
|
||||
free(gtag_elems[0].v.val_str);
|
||||
return -1;
|
||||
|
||||
decode_exit:
|
||||
if (json_obj != NULL) {
|
||||
neu_json_decode_free(json_obj);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void neu_json_decode_gtag_fini(neu_json_gtag_t *gtag)
|
||||
|
||||
@@ -1053,7 +1053,7 @@ class TestModbus:
|
||||
node=param[0], group='group', tag=hold_string_l1[0]['name'], value='a')
|
||||
api.write_tag_check(
|
||||
node=param[0], group='group', tag=hold_string_l2[0]['name'], value='b')
|
||||
time.sleep(0.3)
|
||||
time.sleep(0.5)
|
||||
assert 'a' == api.read_tag(
|
||||
node=param[0], group='group', tag=hold_string_l1[0]['name'])
|
||||
assert 'b' == api.read_tag(
|
||||
|
||||
Reference in New Issue
Block a user