diff options
author | awy <awy@awy.one> | 2025-08-24 00:05:10 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-08-24 00:05:10 +0300 |
commit | 96b0596c8c9caa28040439e8e5389494406f331f (patch) | |
tree | 24ef6f3f9fee64a06fc3e21ccc320aa2b22fcb5b /src | |
parent | 5a0107ba1e9388a3d4ade7faa06a1c94786ae3d2 (diff) |
json tree cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/sttorrent.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sttorrent.c b/src/sttorrent.c index 7a5a73c..a911071 100644 --- a/src/sttorrent.c +++ b/src/sttorrent.c @@ -140,7 +140,10 @@ main(void) torrents = cJSON_GetObjectItem(torrents, "arguments"); torrents = cJSON_GetObjectItem(torrents, "torrents"); - if (cJSON_GetArraySize(torrents) == 0) { return 0; } + if (cJSON_GetArraySize(torrents) == 0) { + cJSON_Delete(torrents); + return 0; + } /* Counting statuses */ for (int i = 0; i < cJSON_GetArraySize(torrents); i++) { @@ -165,5 +168,6 @@ main(void) printf("%d", status_count[i]); } + cJSON_Delete(torrents); return 0; } |