saw this in valgrind (-tony)
authorAnthony Minessale II <anthmct@yahoo.com>
Sat, 29 May 2004 03:40:35 +0000 (03:40 +0000)
committerAnthony Minessale II <anthmct@yahoo.com>
Sat, 29 May 2004 03:40:35 +0000 (03:40 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3107 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_skinny.c

index 093b083..bd86147 100755 (executable)
@@ -2539,6 +2539,7 @@ static int reload_config(void)
                hp = ast_gethostbyname(ourhost, &ahp);
                if (!hp) {
                        ast_log(LOG_WARNING, "Unable to get our IP address, Skinny disabled\n");
+                       ast_destroy(cfg);
                        return 0;
                }
                memcpy(&__ourip, hp->h_addr, sizeof(__ourip));
@@ -2574,6 +2575,7 @@ static int reload_config(void)
                skinnysock = socket(AF_INET, SOCK_STREAM, 0);
                if(setsockopt(skinnysock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) {
                        ast_log(LOG_ERROR, "Set Socket Options failed: errno %d, %s", errno, strerror(errno));
+                       ast_destroy(cfg);
                        return 0;
                }
 
@@ -2586,6 +2588,7 @@ static int reload_config(void)
                                                        strerror(errno));
                                close(skinnysock);
                                skinnysock = -1;
+                               ast_destroy(cfg);
                                return 0;
                        } 
 
@@ -2595,6 +2598,7 @@ static int reload_config(void)
                                                        strerror(errno));
                                        close(skinnysock);
                                        skinnysock = -1;
+                                       ast_destroy(cfg);
                                        return 0;
                        }