<p>Neels Hofmeyr <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/12355">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mgcp_client_vty: fix missing talloc_free<br><br>If the vty client enters multiple local / remote addresses, that leaks talloc<br>memory of the previously set addresses. Free those first, if any, using<br>osmo_talloc_replace_string().<br><br>Change-Id: I331b3d53b5eb330b87d798f952077a043674d409<br>---<br>M src/libosmo-mgcp-client/mgcp_client_vty.c<br>1 file changed, 6 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c</span><br><span>index 48fcd70..ecc205f 100644</span><br><span>--- a/src/libosmo-mgcp-client/mgcp_client_vty.c</span><br><span>+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c</span><br><span>@@ -43,8 +43,9 @@</span><br><span>   if (!global_mgcp_client_conf)</span><br><span>                return CMD_ERR_NOTHING_TODO;</span><br><span>         OSMO_ASSERT(global_mgcp_client_ctx);</span><br><span style="color: hsl(0, 100%, 40%);">-    global_mgcp_client_conf->local_addr =</span><br><span style="color: hsl(0, 100%, 40%);">-                talloc_strdup(global_mgcp_client_ctx, argv[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+       osmo_talloc_replace_string(global_mgcp_client_ctx,</span><br><span style="color: hsl(120, 100%, 40%);">+                               (char**)&global_mgcp_client_conf->local_addr,</span><br><span style="color: hsl(120, 100%, 40%);">+                                  argv[0]);</span><br><span>         return CMD_SUCCESS;</span><br><span> }</span><br><span> ALIAS_DEPRECATED(cfg_mgw_local_ip, cfg_mgcpgw_local_ip_cmd,</span><br><span>@@ -75,8 +76,9 @@</span><br><span>  if (!global_mgcp_client_conf)</span><br><span>                return CMD_ERR_NOTHING_TODO;</span><br><span>         OSMO_ASSERT(global_mgcp_client_ctx);</span><br><span style="color: hsl(0, 100%, 40%);">-    global_mgcp_client_conf->remote_addr =</span><br><span style="color: hsl(0, 100%, 40%);">-               talloc_strdup(global_mgcp_client_ctx, argv[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+       osmo_talloc_replace_string(global_mgcp_client_ctx,</span><br><span style="color: hsl(120, 100%, 40%);">+                               (char**)&global_mgcp_client_conf->remote_addr,</span><br><span style="color: hsl(120, 100%, 40%);">+                                 argv[0]);</span><br><span>         return CMD_SUCCESS;</span><br><span> }</span><br><span> ALIAS_DEPRECATED(cfg_mgw_remote_ip, cfg_mgcpgw_remote_ip_cmd,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12355">change 12355</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/12355"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I331b3d53b5eb330b87d798f952077a043674d409 </div>
<div style="display:none"> Gerrit-Change-Number: 12355 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Vadim Yanitskiy <axilirator@gmail.com> </div>