Update json_token.c

This commit is contained in:
David Lin
2020-03-17 21:10:01 +08:00
committed by GitHub
parent e28acb8a2a
commit ccec7a25b6

View File

@@ -91,6 +91,9 @@ list_head_t *LITE_json_keys_of(char *src, char *prefix)
json_key_t *entry = NULL;
entry = HAL_Malloc(sizeof(json_key_t));
if (NULL == entry) {
return NULL;
}
memset(entry, 0, sizeof(json_key_t));
entry->key = LITE_format_string("%s%.*s", prefix, klen, key);
list_add_tail(&entry->list, &keylist);
@@ -109,6 +112,9 @@ list_head_t *LITE_json_keys_of(char *src, char *prefix)
json_key_t *entry = NULL;
entry = HAL_Malloc(sizeof(json_key_t));
if (NULL == entry) {
return NULL;
}
memset(entry, 0, sizeof(json_key_t));
list_add_tail(&entry->list, &keylist);