From f1b9b6dc5f2428be7e388a084aef352709a962fe Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 23 Jun 2008 20:41:45 +0000 Subject: [PATCH] fix little leak git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8830 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/switch_core.c b/src/switch_core.c index 3e826f27d8..147bf4c6e5 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -625,9 +625,9 @@ static void load_mime_types(void) fd = open(mime_path, O_RDONLY); if (fd <= 0) { - return; + goto end; } - + while ((switch_fd_read_line(fd, line_buf, sizeof(line_buf)))) { char *p; char *type = line_buf; @@ -656,6 +656,11 @@ static void load_mime_types(void) close(fd); fd = -1; } + + end: + + switch_safe_free(mime_path); + } SWITCH_DECLARE(void) switch_core_setrlimits(void)