aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/app_directory.c3
-rw-r--r--apps/app_queue.c6
-rw-r--r--apps/app_voicemail.c2
-rw-r--r--res/res_realtime.c4
4 files changed, 13 insertions, 2 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index fb2c4783c..ded4b85bf 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -383,6 +383,9 @@ static struct ast_config *realtime_directory(char *context)
if (!cat) {
ast_log(LOG_WARNING, "Out of memory\n");
ast_config_destroy(cfg);
+ if (rtdata) {
+ ast_config_destroy(rtdata);
+ }
return NULL;
}
ast_category_append(cfg, cat);
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 88a99bf1c..68023b183 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2032,8 +2032,12 @@ static void leave_queue(struct queue_ent *qe)
/*If the queue is a realtime queue, check to see if it's still defined in real time*/
if (q->realtime) {
- if (!ast_load_realtime("queues", "name", q->name, SENTINEL))
+ struct ast_variable *var;
+ if (!(var = ast_load_realtime("queues", "name", q->name, SENTINEL))) {
q->dead = 1;
+ } else {
+ ast_variables_destroy(var);
+ }
}
if (q->dead) {
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 7eff59772..08cefadf3 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -9610,6 +9610,8 @@ static char *show_users_realtime(int fd, const char *context)
"=============================================================\n"
"\n");
+ ast_config_destroy(cfg);
+
return CLI_SUCCESS;
}
diff --git a/res/res_realtime.c b/res/res_realtime.c
index 60c0b70f0..c69972713 100644
--- a/res/res_realtime.c
+++ b/res/res_realtime.c
@@ -43,7 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *cli_realtime_load(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
#define CRL_HEADER_FORMAT "%30s %-30s\n"
- struct ast_variable *var=NULL;
+ struct ast_variable *var = NULL, *orig_var = NULL;
switch (cmd) {
case CLI_INIT:
@@ -66,6 +66,7 @@ static char *cli_realtime_load(struct ast_cli_entry *e, int cmd, struct ast_cli_
if (var) {
ast_cli(a->fd, CRL_HEADER_FORMAT, "Column Name", "Column Value");
ast_cli(a->fd, CRL_HEADER_FORMAT, "--------------------", "--------------------");
+ orig_var = var;
while (var) {
ast_cli(a->fd, CRL_HEADER_FORMAT, var->name, var->value);
var = var->next;
@@ -73,6 +74,7 @@ static char *cli_realtime_load(struct ast_cli_entry *e, int cmd, struct ast_cli_
} else {
ast_cli(a->fd, "No rows found matching search criteria.\n");
}
+ ast_variables_destroy(orig_var);
return CLI_SUCCESS;
}