]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't assume qlog is open.
authorTilghman Lesher <tilghman@meg.abyt.es>
Sun, 25 Jul 2010 17:32:21 +0000 (17:32 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sun, 25 Jul 2010 17:32:21 +0000 (17:32 +0000)
(closes issue #17704)
 Reported by: vrban
 Patches:
       issue17704.patch uploaded by pabelanger (license 224)
 Tested by: vrban

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@279390 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/logger.c

index 3a28d42b870b2ecfda482ef6ad4c34693cfcde55..304c03a90d4821323dce056d7a86d5e0d26320c9 100644 (file)
@@ -690,9 +690,10 @@ static int reload_logger(int rotate)
                                        break;
                                }
                        }
-
-                       fclose(qlog);
-                       qlog = NULL;
+                       if (qlog) {
+                               fclose(qlog);
+                               qlog = NULL;
+                       }
                        snprintf(old, sizeof(old), "%s/%s", ast_config_AST_LOG_DIR, queue_log_name);
                        if (queue_rotate) {
                                rotate_file(old);
@@ -720,8 +721,9 @@ static int reload_logger(int rotate)
        a full Asterisk reload) */
 int logger_reload(void)
 {
-       if(reload_logger(0))
+       if (reload_logger(0)) {
                return RESULT_FAILURE;
+       }
        return RESULT_SUCCESS;
 }