libctrl: remove reference to bsc_replace_string()
... and rather introduce a general osmo_talloc_replace_string() to
libosmocore.
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index c08e775..373522a 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -1,6 +1,7 @@
#pragma once
#include <osmocom/core/backtrace.h>
+#include <osmocom/core/talloc.h>
/*! \defgroup utils General-purpose utility functions
* @{
@@ -59,5 +60,11 @@
abort(); \
}
+static inline void osmo_talloc_replace_string(void *ctx, char **dst, char *newstr)
+{
+ if (*dst)
+ talloc_free(*dst);
+ *dst = talloc_strdup(ctx, newstr);
+}
/*! @} */