Bug 6862 - No need to initialize memory to zero twice
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 3 Apr 2006 07:30:07 +0000 (07:30 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 3 Apr 2006 07:30:07 +0000 (07:30 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17028 65c4cc65-6c06-0410-ace0-fbb531ad65f3

manager.c

index be1ac1e..f19b07f 100644 (file)
--- a/manager.c
+++ b/manager.c
@@ -2358,7 +2358,6 @@ int init_manager(void)
                ast_log(LOG_NOTICE, "Unable to open management configuration manager.conf.  Call management disabled.\n");
                return 0;
        }
-       memset(&ba, 0, sizeof(ba));
        val = ast_variable_retrieve(cfg, "general", "enabled");
        if (val)
                enabled = ast_true(val);
@@ -2386,11 +2385,11 @@ int init_manager(void)
 
        if ((val = ast_variable_retrieve(cfg, "general", "httptimeout")))
                newhttptimeout = atoi(val);
-       
+
+       memset(&ba, 0, sizeof(ba));
        ba.sin_family = AF_INET;
        ba.sin_port = htons(portno);
-       memset(&ba.sin_addr, 0, sizeof(ba.sin_addr));
-       
+
        if ((val = ast_variable_retrieve(cfg, "general", "bindaddr"))) {
                if (!inet_aton(val, &ba.sin_addr)) { 
                        ast_log(LOG_WARNING, "Invalid address '%s' specified, using 0.0.0.0\n", val);