]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix small memory leak in handle_init_event by always destroying the pthread
authorJeff Peeler <jpeeler@digium.com>
Tue, 15 Sep 2009 16:29:27 +0000 (16:29 +0000)
committerJeff Peeler <jpeeler@digium.com>
Tue, 15 Sep 2009 16:29:27 +0000 (16:29 +0000)
attr before returning.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@218623 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index 47d39d81966425c9d47344cd30d1a9bc0f226750..f3a27d345c32891a8b9a5b015ecf35fcece0cbf8 100644 (file)
@@ -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);