summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-08-24 11:24:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:43 -0500
commit1713b43c1a28aadfecf641dfdd6e070ef3dfba1b (patch)
tree5cacd60751214be823b03865bc5700c71fe5b9dc /source4
parent2fe8a02f98b6c5a1788f209b3e2ed4231323b6b0 (diff)
downloadsamba-1713b43c1a28aadfecf641dfdd6e070ef3dfba1b.tar.gz
samba-1713b43c1a28aadfecf641dfdd6e070ef3dfba1b.tar.bz2
samba-1713b43c1a28aadfecf641dfdd6e070ef3dfba1b.zip
r17792: io.out.winsserver is a const char *,
and iname->winserver = talloc_steal(iname, io.out.winsserver) generated a warning, so I changed iname->winsserver to also be a const char *. then a talloc_free(iname->winsserver) would generate a warning, but we can steal it into the tmp_ctx without a warning and that gets free'ed a few lines later. metze (This used to be commit fdef17f81e5fc48cca3dd7611d6d5007147473b1)
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);