<p>Neels Hofmeyr has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12355">View Change</a></p><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.<br><br>Change-Id: I331b3d53b5eb330b87d798f952077a043674d409<br>---<br>M src/libosmo-mgcp-client/mgcp_client_vty.c<br>1 file changed, 4 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/55/12355/1</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 e19dbee..b81fcd0 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,6 +43,8 @@</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(120, 100%, 40%);">+  if (global_mgcp_client_conf->local_addr)</span><br><span style="color: hsl(120, 100%, 40%);">+           talloc_free((char*)global_mgcp_client_conf->local_addr);</span><br><span>  global_mgcp_client_conf->local_addr =</span><br><span>             talloc_strdup(global_mgcp_client_ctx, argv[0]);</span><br><span>      return CMD_SUCCESS;</span><br><span>@@ -75,6 +77,8 @@</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(120, 100%, 40%);">+  if (global_mgcp_client_conf->remote_addr)</span><br><span style="color: hsl(120, 100%, 40%);">+          talloc_free((char*)global_mgcp_client_conf->remote_addr);</span><br><span>         global_mgcp_client_conf->remote_addr =</span><br><span>            talloc_strdup(global_mgcp_client_ctx, argv[0]);</span><br><span>      return CMD_SUCCESS;</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: newchange </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: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>