Browse code

http_client: check if shm is initialized in curl_parse_param()

Daniel-Constantin Mierla authored on 29/06/2021 05:31:10
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);