From: Jeff Peeler Date: Tue, 15 Sep 2009 16:29:27 +0000 (+0000) Subject: Fix small memory leak in handle_init_event by always destroying the pthread X-Git-Tag: 1.4.27-rc1~2^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=434dcbf8470f9b7a027b10faa95c9a59f89bc9e4;p=thirdparty%2Fasterisk.git Fix small memory leak in handle_init_event by always destroying the pthread attr before returning. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@218623 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 47d39d8196..f3a27d345c 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -7146,6 +7146,7 @@ static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event) 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 @@ static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event) 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 @@ static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event) ast_log(LOG_NOTICE, "Got DAHDI_EVENT_REMOVED. Destroying channel %d\n", i->channel); + pthread_attr_destroy(&attr); return i; } pthread_attr_destroy(&attr);