aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqorg11 <qorg@vxempire.xyz>2021-06-29 15:31:54 +0200
committerqorg11 <qorg@vxempire.xyz>2021-06-29 15:31:54 +0200
commit03d10a52d883e2a3ae5a4cf6e9d13db7706a06ce (patch)
tree4cd267fff6b1bf45886e105f1948250b31a7d9d3
parentb7c4b2bd5ef3118348e6fc49b223754ff39b65c8 (diff)
downloaddemiurge-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/post.c b/src/post.c
index f27ceae..b3ef2c0 100644
--- a/src/post.c
+++ b/src/post.c
@@ -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;
}