[asterisk-commits] jpeeler: branch 1.4 r218623 - /branches/1.4/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 15 11:29:31 CDT 2009


Author: jpeeler
Date: Tue Sep 15 11:29:27 2009
New Revision: 218623

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=218623
Log:
Fix small memory leak in handle_init_event by always destroying the pthread
attr before returning.

Modified:
    branches/1.4/channels/chan_dahdi.c

Modified: branches/1.4/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/channels/chan_dahdi.c?view=diff&rev=218623&r1=218622&r2=218623
==============================================================================
--- branches/1.4/channels/chan_dahdi.c (original)
+++ branches/1.4/channels/chan_dahdi.c Tue Sep 15 11:29:27 2009
@@ -7146,6 +7146,7 @@
 			res = tone_zone_play_tone(i->subs[SUB_REAL].dfd, DAHDI_TONE_CONGESTION);
 			if (res < 0)
 					ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", i->channel);
+			pthread_attr_destroy(&attr);
 			return NULL;
 		}
 		break;
@@ -7212,6 +7213,7 @@
 		default:
 			ast_log(LOG_WARNING, "Don't know how to handle on hook with signalling %s on channel %d\n", sig2str(i->sig), i->channel);
 			res = tone_zone_play_tone(i->subs[SUB_REAL].dfd, -1);
+			pthread_attr_destroy(&attr);
 			return NULL;
 		}
 		break;
@@ -7248,6 +7250,7 @@
 		ast_log(LOG_NOTICE, 
 				"Got DAHDI_EVENT_REMOVED. Destroying channel %d\n", 
 				i->channel);
+		pthread_attr_destroy(&attr);
 		return i;
 	}
 	pthread_attr_destroy(&attr);




More information about the asterisk-commits mailing list