diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-20 08:55:04 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-20 08:55:04 +0800 |
commit | 88c0da9ea0b8a53d5ee5038099f3df1a5a586d4f (patch) | |
tree | 5fedfc26ef6840ddc1369ac004a99c9d0c92b544 | |
parent | ac4aa1e741bd15d33bdaa959be1a73732eda8359 (diff) |
post was never made sure NULL in the first place
-rw-r--r-- | request.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |