]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Memory Leak in app_queue
authorRichard Mudgett <rmudgett@digium.com>
Tue, 23 Aug 2011 18:14:01 +0000 (18:14 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 23 Aug 2011 18:14:01 +0000 (18:14 +0000)
The patch that was committed in the 1.6.x versions of Asterisk for
ASTERISK-15862 actually fixed two issues.  One was not applicable to 1.8
but the other is.  queue_leak.patch fixes the portion applicable to 1.8.

(closes issue ASTERISK-18265)
Reported by: Fred Schroeder
Patches:
      queue_leak.patch (license #5049) patch uploaded by mmichelson
Tested by: Thomas Arimont

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

apps/app_queue.c

index c63c29417378e9854f8926d0ddb66b5f0d327236..52e10796a836a92ab4eb6d34b10104540c0035d7 100644 (file)
@@ -1719,8 +1719,13 @@ static void init_queue(struct call_queue *q)
        ast_string_field_set(q, sound_thanks, "queue-thankyou");
        ast_string_field_set(q, sound_reporthold, "queue-reporthold");
 
-       if ((q->sound_periodicannounce[0] = ast_str_create(32)))
+       if (!q->sound_periodicannounce[0]) {
+               q->sound_periodicannounce[0] = ast_str_create(32);
+       }
+
+       if (q->sound_periodicannounce[0]) {
                ast_str_set(&q->sound_periodicannounce[0], 0, "queue-periodic-announce");
+       }
 
        for (i = 1; i < MAX_PERIODIC_ANNOUNCEMENTS; i++) {
                if (q->sound_periodicannounce[i])