Always free cfg file
authorMark Spencer <markster@digium.com>
Mon, 4 Aug 2003 21:44:48 +0000 (21:44 +0000)
committerMark Spencer <markster@digium.com>
Mon, 4 Aug 2003 21:44:48 +0000 (21:44 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1259 65c4cc65-6c06-0410-ace0-fbb531ad65f3

manager.c

index f7761d6..dea2b12 100755 (executable)
--- a/manager.c
+++ b/manager.c
@@ -866,9 +866,12 @@ int init_manager(void)
                ast_log(LOG_WARNING, "Unable to change management port / enabled\n");
 #endif
        }
+       ast_destroy(cfg);
+       
        /* If not enabled, do nothing */
-       if (!enabled)
+       if (!enabled) {
                return 0;
+       }
        if (asock < 0) {
                asock = socket(AF_INET, SOCK_STREAM, 0);
                if (asock < 0) {
@@ -892,7 +895,6 @@ int init_manager(void)
                        ast_verbose("Asterisk Management interface listening on port %d\n", portno);
                pthread_create(&t, NULL, accept_thread, NULL);
        }
-       ast_destroy(cfg);
        return 0;
 }