diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-09 22:03:42 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-09 22:03:42 +0000 |
commit | 295911c6df2fa0db4df85dea8c07ededdcc0196d (patch) | |
tree | 7688cd465d4683df35221b82ea281c068a82d9a0 | |
parent | 58363a66b44275c35e728b4d3cf6b66b91d4e2ac (diff) |
fix memory leak with DelayedRetry (issue #6157)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.0@7914 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | pbx/pbx_spool.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c index fcf50c271..b8b06ed8f 100644 --- a/pbx/pbx_spool.c +++ b/pbx/pbx_spool.c @@ -271,9 +271,11 @@ static int scan_service(char *fn, time_t now, time_t atime) #endif fclose(f); if (o->retries <= o->maxretries) { + now += o->retrytime; if (o->callingpid && (o->callingpid == ast_mainpid)) { safe_append(o, time(NULL), "DelayedRetry"); ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn); + free(o); } else { /* Increment retries */ o->retries++; @@ -285,7 +287,6 @@ static int scan_service(char *fn, time_t now, time_t atime) safe_append(o, now, "StartRetry"); launch_service(o); } - now += o->retrytime; 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); |