Merged revisions 90101 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Wed, 28 Nov 2007 23:03:09 +0000 (23:03 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 28 Nov 2007 23:03:09 +0000 (23:03 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90101 | file | 2007-11-28 18:59:28 -0400 (Wed, 28 Nov 2007) | 6 lines

Fix a few memory leaks.
(closes issue #11405)
Reported by: eliel
Patches:
      load_realtime.patch uploaded by eliel (license 64)

........

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

apps/app_queue.c
res/res_musiconhold.c

index b24200c..274ae30 100644 (file)
@@ -1362,6 +1362,7 @@ static struct call_queue *load_realtime_queue(const char *queuename)
                        member_config = ast_load_realtime_multientry("queue_members", "interface LIKE", "%", "queue_name", queuename, NULL);
                        if (!member_config) {
                                ast_log(LOG_ERROR, "no queue_members defined in your config (extconfig.conf).\n");
+                               ast_variables_destroy(queue_vars);
                                return NULL;
                        }
                }
index 027aed0..985dc80 100644 (file)
@@ -1108,6 +1108,7 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
                                        }
                                }
                        }
+                       ast_variables_destroy(var);
                        if (ast_strlen_zero(mohclass->dir)) {
                                if (!strcasecmp(mohclass->mode, "custom")) {
                                        strcpy(mohclass->dir, "nodir");
@@ -1206,7 +1207,8 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
 
                        }
 
-               }
+               } else if (var)
+                       ast_variables_destroy(var);
        }