aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-03 20:39:10 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-03 20:39:10 +0000
commit0e21d4de4ae87afdd5ddf27a33de1cfb417f0d66 (patch)
treef0db6a8f6e0db584ccab53eada8539eebdeb6feb
parentec2b265188e685c041b0dbd1f5e978a633e84a25 (diff)
Fix a possible crash in pbx_spool.
We were trying to reference members of a struct that had previously been freed. This patch makes sure that we free the struct after it has been removed from the spooler queue. (closes issue #15072) Reported by: garlew Patches: spool.diff uploaded by garlew (license 376) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@198957 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--pbx/pbx_spool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index 8c8880d72..3ab4e8385 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -419,20 +419,20 @@ static int scan_service(char *fn, time_t now, time_t atime)
return now;
} else {
ast_log(LOG_EVENT, "Queued call to %s/%s expired without completion after %d attempt%s\n", o->tech, o->dest, o->retries - 1, ((o->retries - 1) != 1) ? "s" : "");
- free_outgoing(o);
remove_from_queue(o, "Expired");
+ free_outgoing(o);
return 0;
}
} else {
- free_outgoing(o);
ast_log(LOG_WARNING, "Invalid file contents in %s, deleting\n", fn);
fclose(f);
remove_from_queue(o, "Failed");
+ free_outgoing(o);
}
} else {
- free_outgoing(o);
ast_log(LOG_WARNING, "Unable to open %s: %s, deleting\n", fn, strerror(errno));
remove_from_queue(o, "Failed");
+ free_outgoing(o);
}
} else
ast_log(LOG_WARNING, "Out of memory :(\n");