Ver Fonte

modules/ims_usrloc_pcscf: fix segfault when running in DB mode (deleting contact)

Jason Penton há 11 anos atrás
pai
commit
2977c559d8
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      modules/ims_usrloc_pcscf/udomain.c

+ 2 - 1
modules/ims_usrloc_pcscf/udomain.c

@@ -551,13 +551,14 @@ int delete_pcontact(udomain_t* _d, str* _aor, struct pcontact* _c)
 	if (exists_ulcb_type(PCSCF_CONTACT_DELETE)) {
 	if (exists_ulcb_type(PCSCF_CONTACT_DELETE)) {
 		run_ul_callbacks(PCSCF_CONTACT_DELETE, _c);
 		run_ul_callbacks(PCSCF_CONTACT_DELETE, _c);
 	}
 	}
-	mem_delete_pcontact(_d, _c);
 
 
 	if (db_mode == WRITE_THROUGH && db_delete_pcontact(_c) != 0) {
 	if (db_mode == WRITE_THROUGH && db_delete_pcontact(_c) != 0) {
 		LM_ERR("Error deleting contact from DB");
 		LM_ERR("Error deleting contact from DB");
 		return -1;
 		return -1;
 	}
 	}
 
 
+	mem_delete_pcontact(_d, _c);
+
 	return 0;
 	return 0;
 }
 }