Browse code

corrected potential memory leak sources (shown under "heavy load")

Vaclav Kubart authored on 03/03/2006 10:46:16
Showing 1 changed files
... ...
@@ -767,6 +767,7 @@ int new_dlg_uas(struct sip_msg* _req, int _code, /*str* _tag,*/ dlg_t** _d)
767 767
 
768 768
 	if (request2dlg(_req, res) < 0) {
769 769
 		LOG(L_ERR, "new_dlg_uas(): Error while converting request to dialog\n");
770
+		free_dlg(res);
770 771
 		return -4;
771 772
 	}
772 773
 
... ...
@@ -783,7 +784,7 @@ int new_dlg_uas(struct sip_msg* _req, int _code, /*str* _tag,*/ dlg_t** _d)
783 784
 	(*_d)->state = DLG_CONFIRMED;
784 785
 	if (calculate_hooks(*_d) < 0) {
785 786
 		LOG(L_ERR, "new_dlg_uas(): Error while calculating hooks\n");
786
-		shm_free(*_d);
787
+		free_dlg(res);
787 788
 		return -6;
788 789
 	}
789 790