aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-11-30 20:15:22 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-11-30 20:17:25 +0700
commit657a4c0ccd42419233898826ea5b026528bdcce8 (patch)
tree11bdb24cf524b638b74df174bdb80f90c238b468
parentfc75cc0ecf74a961ed32149702a0b4346c0269df (diff)
VTY: cosmetic: use osmo_talloc_replace_string()
-rw-r--r--src/pcu_vty.c6
1 files 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 <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 @@ 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;
}