Browse code

http_client: check if shm is initialized in curl_parse_param()

(cherry picked from commit 7741ad7979d54fb4ee1247760d8d5c3666353a96)
(cherry picked from commit b27dc141ccddfb3e0f77399ead8b2b158942de69)
(cherry picked from commit 2ab8cb38f9ddf01e174c3525ebdec35d6c83406e)

Daniel-Constantin Mierla authored on 29/06/2021 05:31:10 • Henning Westerholt committed on 22/10/2021 12:02:53
Showing 1 changed files
... ...
@@ -32,6 +32,7 @@
32 32
 #include "../../core/dprint.h"
33 33
 #include "../../core/parser/parse_param.h"
34 34
 #include "../../core/usr_avp.h"
35
+#include "../../core/shm_init.h"
35 36
 #include "../../core/cfg_parser.h"
36 37
 #include "http_client.h"
37 38
 #include "curlcon.h"
... ...
@@ -237,6 +238,11 @@ int curl_parse_param(char *val)
237 238
 	LM_DBG("modparam httpcon: %s\n", val);
238 239
 	LM_DBG(" *** Default httproxy: %s\n", http_proxy.s);
239 240
 
241
+	if(!shm_initialized()) {
242
+		LM_ERR("shared memory was not initialized\n");
243
+		return -1;
244
+	}
245
+
240 246
 	/* parse: name=>http_url*/
241 247
 	in.s = val;
242 248
 	in.len = strlen(in.s);