Skip to content

Commit

Permalink
fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Aug 14, 2023
1 parent 6f04467 commit 507d469
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/toniesJson.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ void tonies_readJson()
{
cJSON *arrayJson;
toniesJson_item_t *item = &toniesJsonCache[line++];
item->no = atoi(tonies_jsonGetString(tonieJson, "no"));
char *no_str = tonies_jsonGetString(tonieJson, "no");
item->no = atoi(no_str);
free(no_str);
item->model = tonies_jsonGetString(tonieJson, "model");

arrayJson = cJSON_GetObjectItem(tonieJson, "audio_id");
Expand Down

0 comments on commit 507d469

Please sign in to comment.