Module: kamailio
Branch: master
Commit: b16550fa72d23084b4221769fe74b1f3c357c9fd
URL: 
https://github.com/kamailio/kamailio/commit/b16550fa72d23084b4221769fe74b1f3c357c9fd

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2025-01-27T16:06:49+01:00

http_async_client: check returned cell inside check_multi_info()

---

Modified: src/modules/http_async_client/http_multi.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/b16550fa72d23084b4221769fe74b1f3c357c9fd.diff
Patch: 
https://github.com/kamailio/kamailio/commit/b16550fa72d23084b4221769fe74b1f3c357c9fd.patch

---

diff --git a/src/modules/http_async_client/http_multi.c 
b/src/modules/http_async_client/http_multi.c
index 30ae016d720..7edc0ddc1a0 100644
--- a/src/modules/http_async_client/http_multi.c
+++ b/src/modules/http_async_client/http_multi.c
@@ -604,7 +604,7 @@ void check_multi_info(struct http_m_global *g)
        CURL *easy;
        CURLcode res;
 
-       struct http_m_cell *cell;
+       struct http_m_cell *cell = NULL;
        double tmp_time;
 
        LM_DBG("REMAINING: %d\n", g->still_running);
@@ -616,9 +616,15 @@ void check_multi_info(struct http_m_global *g)
                        curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, 
&eff_url);
 
 
-                       LM_DBG("DONE: %s => (%d) %s\n", eff_url, res, 
cell->error);
+                       LM_DBG("DONE: %s => (%d)\n", eff_url, res);
 
                        cell = http_m_cell_lookup(easy);
+                       if(cell == NULL) {
+                               LM_ERR("failed to get the cell\n");
+                               curl_multi_remove_handle(g->multi, easy);
+                               curl_easy_cleanup(easy);
+                               continue;
+                       }
                        if(msg->data.result != 0) {
                                LM_ERR("handle %p returned error %d: %s\n", 
easy, res,
                                                cell->error);

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to