Change in osmo-pcu[master]: VTY: cosmetic: use osmo_talloc_replace_string()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Sat Nov 30 13:27:53 UTC 2019


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/16346 )


Change subject: VTY: cosmetic: use osmo_talloc_replace_string()
......................................................................

VTY: cosmetic: use osmo_talloc_replace_string()

Change-Id: Id09c7d24b48ddecfa96404c3e75330465a11f830
---
M src/pcu_vty.c
1 file changed, 2 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/46/16346/1

diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 1f46707..afc8a9b 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <osmocom/core/tdef.h>
+#include <osmocom/core/utils.h>
 #include <osmocom/vty/tdef_vty.h>
 #include <osmocom/vty/logging.h>
 #include <osmocom/vty/stats.h>
@@ -1100,10 +1101,7 @@
 	if (vty->type != VTY_FILE)
 		vty_out(vty, "Changing PCU socket path at run-time has no effect%s", VTY_NEWLINE);
 
-	if (bts->pcu_sock_path) {
-		talloc_free(bts->pcu_sock_path);
-	}
-	bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, argv[0]);
+	osmo_talloc_replace_string(tall_pcu_ctx, &bts->pcu_sock_path, argv[0]);
 
 	return CMD_SUCCESS;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/16346
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Id09c7d24b48ddecfa96404c3e75330465a11f830
Gerrit-Change-Number: 16346
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191130/d9c62017/attachment.htm>


More information about the gerrit-log mailing list