[svn-commits] branch 1.2 r18250 - /branches/1.2/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Apr 7 06:47:35 MST 2006


Author: oej
Date: Fri Apr  7 08:47:32 2006
New Revision: 18250

URL: http://svn.digium.com/view/asterisk?rev=18250&view=rev
Log:
- Fix possible minor memory leak in chan_sip
- Return proper cause code on memory allocation error


Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?rev=18250&r1=18249&r2=18250&view=diff
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Fri Apr  7 08:47:32 2006
@@ -11552,13 +11552,16 @@
 	}
 	p = sip_alloc(NULL, NULL, 0, SIP_INVITE);
 	if (!p) {
-		ast_log(LOG_WARNING, "Unable to build sip pvt data for '%s'\n", (char *)data);
+		ast_log(LOG_ERROR, "Unable to build sip pvt data for '%s' (Out of memory)\n", (char *)data);
+		*cause = AST_CAUSE_CONGESTION;
 		return NULL;
 	}
 
 	p->options = calloc(1, sizeof(*p->options));
 	if (!p->options) {
-		ast_log(LOG_ERROR, "Out of memory\n");
+		sip_destroy(p);
+		ast_log(LOG_ERROR, "Unable to build option SIP data structure - Out of memory\n");
+		*cause = AST_CAUSE_CONGESTION;
 		return NULL;
 	}
 



More information about the svn-commits mailing list