VTY: cosmetic: use osmo_talloc_replace_string()

Change-Id: Id09c7d24b48ddecfa96404c3e75330465a11f830
This commit is contained in:
Vadim Yanitskiy 2019-11-30 20:15:22 +07:00
parent fc75cc0ecf
commit 657a4c0ccd
1 changed files with 2 additions and 4 deletions

View File

@ -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;
}