summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/nbt_server/nbt_server.h2
-rw-r--r--source4/nbt_server/wins/winsclient.c12
2 files changed, 11 insertions, 3 deletions
diff --git a/source4/nbt_server/nbt_server.h b/source4/nbt_server/nbt_server.h
index 3b70c0a330..ebf1edb81f 100644
--- a/source4/nbt_server/nbt_server.h
+++ b/source4/nbt_server/nbt_server.h
@@ -39,7 +39,7 @@ struct nbtd_iface_name {
/* if registered with a wins server, then this lists the server being
used */
- char *wins_server;
+ const char *wins_server;
};
diff --git a/source4/nbt_server/wins/winsclient.c b/source4/nbt_server/wins/winsclient.c
index bfaf1edbde..458d1a434d 100644
--- a/source4/nbt_server/wins/winsclient.c
+++ b/source4/nbt_server/wins/winsclient.c
@@ -111,7 +111,11 @@ static void nbtd_wins_refresh_handler(struct composite_context *c)
/* success - start a periodic name refresh */
iname->nb_flags |= NBT_NM_ACTIVE;
if (iname->wins_server) {
- talloc_free(iname->wins_server);
+ /*
+ * talloc_free() would generate a warning,
+ * so steal it into the tmp context
+ */
+ talloc_steal(tmp_ctx, iname->wins_server);
}
iname->wins_server = talloc_steal(iname, io.out.wins_server);
@@ -204,7 +208,11 @@ static void nbtd_wins_register_handler(struct composite_context *c)
/* success - start a periodic name refresh */
iname->nb_flags |= NBT_NM_ACTIVE;
if (iname->wins_server) {
- talloc_free(iname->wins_server);
+ /*
+ * talloc_free() would generate a warning,
+ * so steal it into the tmp context
+ */
+ talloc_steal(tmp_ctx, iname->wins_server);
}
iname->wins_server = talloc_steal(iname, io.out.wins_server);