Browse code

dmq_usrloc: don't destroy json doc before we're done with it.

Charles Chance authored on 14/07/2015 21:59:10
Showing 1 changed files
... ...
@@ -328,7 +328,6 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t*
328 328
 			LM_ERR("unrecognized field in json object\n");
329 329
 		}
330 330
 	}
331
-	srjson_DestroyDoc(&jdoc);
332 331
 	memset( &ci, 0, sizeof(ucontact_info_t));
333 332
 	ci.ruid = ruid;
334 333
 	ci.c = &c;
... ...
@@ -367,16 +366,19 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t*
367 366
 		default:  goto invalid;
368 367
 	}
369 368
 
369
+	srjson_DestroyDoc(&jdoc);
370 370
 	resp->reason = dmq_200_rpl;
371 371
 	resp->resp_code = 200;
372 372
 	return 0;
373 373
 
374 374
 invalid:
375
+	srjson_DestroyDoc(&jdoc);
375 376
 	resp->reason = dmq_400_rpl;
376 377
 	resp->resp_code = 400;
377 378
 	return 0;
378 379
 
379 380
 error:
381
+	srjson_DestroyDoc(&jdoc);
380 382
 	resp->reason = dmq_500_rpl;
381 383
 	resp->resp_code = 500;
382 384
 	return 0;