mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Audit ast_sockaddr_resolve() usage for memory leaks.
Valgrind found some memory leaks associated with ast_sockaddr_resolve(). Most of the leaks had already been fixed by earlier memory leak hunt patches. This patch performs an audit of ast_sockaddr_resolve() and found one more. * Fix ast_sockaddr_resolve() memory leak in apps/app_externalivr.c:app_exec(). * Made main/netsock2.c:ast_sockaddr_resolve() always set the addrs parameter for safety so the pointer will never be uninitialized on return. The same goes for res/res_pjsip_acl.c:extract_contact_addr(). * Made functions that call ast_sockaddr_resolve() with RAII_VAR() controlling the addrs variable use ast_free instead of ast_free_ptr to provide better MALLOC_DEBUG information. Review: https://reviewboard.asterisk.org/r/4509/ ........ Merged revisions 433056 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -619,7 +619,7 @@ static int negotiate_incoming_sdp_stream(struct ast_sip_session *session, struct
|
||||
{
|
||||
struct t38_state *state;
|
||||
char host[NI_MAXHOST];
|
||||
RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free_ptr);
|
||||
RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free);
|
||||
|
||||
if (!session->endpoint->media.t38.enabled) {
|
||||
return -1;
|
||||
@@ -762,7 +762,7 @@ static int apply_negotiated_sdp_stream(struct ast_sip_session *session, struct a
|
||||
const struct pjmedia_sdp_session *local, const struct pjmedia_sdp_media *local_stream,
|
||||
const struct pjmedia_sdp_session *remote, const struct pjmedia_sdp_media *remote_stream)
|
||||
{
|
||||
RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free_ptr);
|
||||
RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free);
|
||||
char host[NI_MAXHOST];
|
||||
struct t38_state *state;
|
||||
|
||||
|
Reference in New Issue
Block a user