diff options
author | qorg11 <qorg@vxempire.xyz> | 2021-06-29 15:31:54 +0200 |
---|---|---|
committer | qorg11 <qorg@vxempire.xyz> | 2021-06-29 15:31:54 +0200 |
commit | 03d10a52d883e2a3ae5a4cf6e9d13db7706a06ce (patch) | |
tree | 4cd267fff6b1bf45886e105f1948250b31a7d9d3 | |
parent | b7c4b2bd5ef3118348e6fc49b223754ff39b65c8 (diff) | |
download | demiurge-03d10a52d883e2a3ae5a4cf6e9d13db7706a06ce.tar.gz demiurge-03d10a52d883e2a3ae5a4cf6e9d13db7706a06ce.zip |
Fix memory leak
It only fixes the memory leak while posting without a file so i'm
still working on that
-rw-r--r-- | src/post.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -93,6 +93,9 @@ post_status(const char *status, const char *scope, const char *media_id) curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime); curl_easy_perform(curl); + + /* free */ + curl_easy_cleanup(curl); curl_slist_free_all(header_list); curl_mime_free(mime); @@ -109,8 +112,7 @@ post_status(const char *status, const char *scope, const char *media_id) free(url); free(authorization_header); free(chunk.response); - free(parsed_json); - free(json_url); + json_object_put(parsed_json); return 0; } |