~ubuntu-branches/ubuntu/dapper/asterisk/dapper-security

« back to all changes in this revision

Viewing changes to channels/chan_features.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-05-18 10:21:06 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060518102106-5vgpbtylsvr9jiu3
Tags: 1:1.2.7.1.dfsg-2ubuntu1
* Resynchronized with Debian, only Ubuntu changes:
  - debian/*.init:
    - create /var/run/ directory if necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
#include "asterisk.h"
41
41
 
42
 
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 7221 $")
 
42
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 8666 $")
43
43
 
44
44
#include "asterisk/lock.h"
45
45
#include "asterisk/channel.h"
568
568
 
569
569
int unload_module()
570
570
{
571
 
        struct feature_pvt *p;
 
571
        struct feature_pvt *p, *prev;
572
572
        /* First, take us out of the channel loop */
573
573
        ast_cli_unregister(&cli_show_features);
574
574
        ast_channel_unregister(&features_tech);
575
575
        if (!ast_mutex_lock(&featurelock)) {
576
576
                /* Hangup all interfaces if they have an owner */
577
 
                p = features;
578
 
                while(p) {
 
577
                for (p = features; p; p = p->next) {
 
578
                        prev = p;
579
579
                        if (p->owner)
580
580
                                ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
581
 
                        p = p->next;
 
581
                        free(prev);
582
582
                }
583
583
                features = NULL;
584
584
                ast_mutex_unlock(&featurelock);