mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user