summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-20 08:55:04 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-20 08:55:04 +0800
commit88c0da9ea0b8a53d5ee5038099f3df1a5a586d4f (patch)
tree5fedfc26ef6840ddc1369ac004a99c9d0c92b544
parentac4aa1e741bd15d33bdaa959be1a73732eda8359 (diff)
post was never made sure NULL in the first place
-rw-r--r--request.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/request.c b/request.c
index f61d4e8..06c0d4f 100644
--- a/request.c
+++ b/request.c
@@ -156,7 +156,8 @@ void request(void (*handler)(icclient_response *), void (*callback)(void *), str
response->numBytes = 0;
response->userData = callback;
curl_easy_setopt(curl, CURLOPT_WRITEDATA, response);
- struct curl_httppost *post, *last = NULL;
+ struct curl_httppost *post = NULL;
+ struct curl_httppost *last = NULL;
if (body) {
for (size_t i = 0; i < body->num_pairs; i++) {
struct pair pair = body->pairs[i];
@@ -170,7 +171,7 @@ void request(void (*handler)(icclient_response *), void (*callback)(void *), str
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
struct container *container = malloc(sizeof(struct container));
container->curl = curl;
- container->post = post ? post : NULL;
+ container->post = post;
container->handler = handler;
container->response = response;
thrd_t thread;