<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6382">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">rtp_engine: Prevent possible double free with DTLS config<br><br>ASTERISK-27225 #close<br>Reported by: Richard Kenner<br><br>Change-Id: I097b81734ef730f8603c0b972909d212a3a5cf89<br>---<br>M main/rtp_engine.c<br>1 file changed, 4 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/rtp_engine.c b/main/rtp_engine.c<br>index e078b24..226b229 100644<br>--- a/main/rtp_engine.c<br>+++ b/main/rtp_engine.c<br>@@ -2718,35 +2718,35 @@<br> return -1;<br> }<br> } else if (!strcasecmp(name, "dtlscertfile")) {<br>- ast_free(dtls_cfg->certfile);<br> if (!ast_strlen_zero(value) && !ast_file_is_readable(value)) {<br> ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);<br> return -1;<br> }<br>+ ast_free(dtls_cfg->certfile);<br> dtls_cfg->certfile = ast_strdup(value);<br> } else if (!strcasecmp(name, "dtlsprivatekey")) {<br>- ast_free(dtls_cfg->pvtfile);<br> if (!ast_strlen_zero(value) && !ast_file_is_readable(value)) {<br> ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);<br> return -1;<br> }<br>+ ast_free(dtls_cfg->pvtfile);<br> dtls_cfg->pvtfile = ast_strdup(value);<br> } else if (!strcasecmp(name, "dtlscipher")) {<br> ast_free(dtls_cfg->cipher);<br> dtls_cfg->cipher = ast_strdup(value);<br> } else if (!strcasecmp(name, "dtlscafile")) {<br>- ast_free(dtls_cfg->cafile);<br> if (!ast_strlen_zero(value) && !ast_file_is_readable(value)) {<br> ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);<br> return -1;<br> }<br>+ ast_free(dtls_cfg->cafile);<br> dtls_cfg->cafile = ast_strdup(value);<br> } else if (!strcasecmp(name, "dtlscapath") || !strcasecmp(name, "dtlscadir")) {<br>- ast_free(dtls_cfg->capath);<br> if (!ast_strlen_zero(value) && !ast_file_is_readable(value)) {<br> ast_log(LOG_ERROR, "%s file %s does not exist or is not readable\n", name, value);<br> return -1;<br> }<br>+ ast_free(dtls_cfg->capath);<br> dtls_cfg->capath = ast_strdup(value);<br> } else if (!strcasecmp(name, "dtlssetup")) {<br> if (!strcasecmp(value, "active")) {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6382">change 6382</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6382"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I097b81734ef730f8603c0b972909d212a3a5cf89 </div>
<div style="display:none"> Gerrit-Change-Number: 6382 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>