aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-25 18:39:44 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-25 18:39:44 +0000
commit40bbd46160d822ea58474bac68c08417bcfd0bab (patch)
tree59addcafb77ff70470d05368a48a0e4c4abb033e
parentad8a078e24efbd489d256b71d4bb92da61b8aaf8 (diff)
fix memory leak (inspired by issue #6351)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@8666 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_features.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/channels/chan_features.c b/channels/chan_features.c
index 32deae12f..97bbdf8ed 100644
--- a/channels/chan_features.c
+++ b/channels/chan_features.c
@@ -568,17 +568,17 @@ int reload()
int unload_module()
{
- struct feature_pvt *p;
+ struct feature_pvt *p, *prev;
/* First, take us out of the channel loop */
ast_cli_unregister(&cli_show_features);
ast_channel_unregister(&features_tech);
if (!ast_mutex_lock(&featurelock)) {
/* Hangup all interfaces if they have an owner */
- p = features;
- while(p) {
+ for (p = features; p; p = p->next) {
+ prev = p;
if (p->owner)
ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
- p = p->next;
+ free(prev);
}
features = NULL;
ast_mutex_unlock(&featurelock);