[asterisk-bugs] [JIRA] (ASTERISK-27869) couple of memory leaks (detected by cppcheck)

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Mon May 21 12:02:56 CDT 2018


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

Richard Mudgett commented on ASTERISK-27869:
--------------------------------------------

Yep.  The 'for_loop' and 'while_loop' variables do appear to be leaked when gen_prios() returns non-zero for an error.  When gen_prios() returns error, it causes ast_compile_ael2() to fail, which causes the AEL diaplan module load to decline/fail.  gen_prios() returns error because of a memory allocation failure.  There is no good fix for the leak because of how the code is written.  The best way I think it could be fixed without rewriting gen_prios() is to defer returning error until the end of the switch case which would be after the associated linkprio() calls have linked the leaked memory items into the exten object.

Please be aware that the Asterisk Extension Language (AEL) is an extended support feature \[1] with no designated maintainer.  Support must come from the community so response times will reflect that.

\[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States

> couple of memory leaks (detected by cppcheck)
> ---------------------------------------------
>
>                 Key: ASTERISK-27869
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27869
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_ael_share
>    Affects Versions: 13.21.0, 15.4.0
>            Reporter: Ilya Shipitsin
>            Severity: Minor
>
> {noformat}
> [res/ael/pval.c:3632]: (error) Memory leak: for_loop
> [res/ael/pval.c:3672]: (error) Memory leak: while_loop
> {noformat}



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



More information about the asterisk-bugs mailing list