]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Bug 6157 - Memory leak
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 9 Jan 2006 20:08:24 +0000 (20:08 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 9 Jan 2006 20:08:24 +0000 (20:08 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7908 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx/pbx_spool.c

index 244f7b2f5798cd2263ae2c133d7d043db617f5f7..a7dbed32cc4d746ddc95a576a9556f86fa5d0b4d 100644 (file)
@@ -313,8 +313,10 @@ 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");
+                                               free_outgoing(o);
                                                ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
                                        } else {
                                                /* Increment retries */
@@ -327,7 +329,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, ((o->retries - 1) != 1) ? "s" : "");