mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
Fix more memory leaks
This patch adds to what was fixed in r366880. Specifically, it addresses the following: * chan_sip: dispose of an allocated frame in off nominal code paths in sip_rtp_read * func_odbc: when disposing of an allocated resultset, ensure that any rows that were appended to that resultset are also disposed of * cli: free the created return string buffer in another off nominal code path * chan_dahdi: free a frame that was allocated by the dsp layer if we choose not to process that frame (issue ASTERISK-19665) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1922/ ........ Merged revisions 366944 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366948 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2360,8 +2360,10 @@ char **ast_cli_completion_matches(const char *text, const char *word)
|
||||
|
||||
/* ensure that the array is NULL terminated */
|
||||
if (matches + 1 >= match_list_len) {
|
||||
if (!(match_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(*match_list))))
|
||||
if (!(match_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(*match_list)))) {
|
||||
ast_free(retstr);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
match_list[matches + 1] = NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user