Browse code

dmq: access val after being tested for null

Daniel-Constantin Mierla authored on 02/04/2021 08:04:10
Showing 1 changed files
... ...
@@ -365,14 +365,14 @@ static void destroy(void)
365 365
 static int dmq_add_notification_address(modparam_t type, void * val)
366 366
 {
367 367
 	str tmp_str;
368
-	tmp_str.s = ((str*) val)->s;
369
-	tmp_str.len = ((str*) val)->len;
370 368
 	int total_list = 0; /* not used */
371 369
 
372 370
 	if(val==NULL) {
373 371
 		LM_ERR("invalid notification address parameter value\n");
374 372
 		return -1;
375 373
 	}
374
+	tmp_str.s = ((str*) val)->s;
375
+	tmp_str.len = ((str*) val)->len;
376 376
 	if(parse_uri(tmp_str.s,  tmp_str.len, &dmq_notification_uri) < 0) {
377 377
 		LM_ERR("could not parse notification address\n");
378 378
 		return -1;