[asterisk-bugs] [JIRA] (ASTERISK-23616) Big memory leak in logger.c

Matt Jordan (JIRA) noreply at issues.asterisk.org
Thu Apr 10 13:28:18 CDT 2014


    [ https://issues.asterisk.org/jira/browse/ASTERISK-23616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=217218#comment-217218 ] 

Matt Jordan commented on ASTERISK-23616:
----------------------------------------

I'm fairly confident that this was already fixed in r399513:

{noformat}
------------------------------------------------------------------------
r399513 | kharwell | 2013-09-20 09:23:30 -0500 (Fri, 20 Sep 2013) | 8 lines

Fix memory leak in logger.

Fixed a memory leak discovered in the logger where a temporary string buffer
was not being freed.

(closes issue ASTERISK-22540)
Reported by: John Hardin
{noformat}

{noformat}
Index: main/logger.c
===================================================================
--- main/logger.c	(revision 399512)
+++ main/logger.c	(revision 399513)
@@ -1811,6 +1811,7 @@
 	res = ast_str_set_va(&buf, 0, fmt, ap);
 	/* If the build failed then we can drop this allocated message */
 	if (res == AST_DYNSTR_BUILD_FAILED) {
+		ast_free(buf);
 		return;
 	}
 
@@ -1838,6 +1839,7 @@
 	} while (p && *p);
 
 	ast_log_callid(__LOG_VERBOSE, file, line, func, callid, "%s", ast_str_buffer(prefixed));
+	ast_free(buf);
 }
 
 void __ast_verbose(const char *file, int line, const char *func, int level, const char *fmt, ...)
{noformat}

This should have been fixed in the final release of Asterisk 11.7.0; if you're running the release candidate you would be running into this. You may want to jump to 11.8.0, as that should definitely include the fix.

> Big memory leak in logger.c
> ---------------------------
>
>                 Key: ASTERISK-23616
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23616
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/Logging
>    Affects Versions: 11.7.0
>            Reporter: ibercom
>         Attachments: memory.tar.gz
>
>
> Once under a non-trivial load, Asterisk 11 produces a high volume of memory leak in logger.c
> After processing 40039 calls "memory show summary" shows 176983 allocations:
> 560830 bytes in      13817 allocations in file logger.c
> It grows and grows.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list