From 657a4c0ccd42419233898826ea5b026528bdcce8 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 30 Nov 2019 20:15:22 +0700 Subject: VTY: cosmetic: use osmo_talloc_replace_string() Change-Id: Id09c7d24b48ddecfa96404c3e75330465a11f830 --- src/pcu_vty.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 1f46707e..afc8a9ba 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -1100,10 +1101,7 @@ DEFUN(cfg_pcu_sock, 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; } -- cgit v1.2.3