Author: metze
Date: 2006-08-24 11:24:06 +0000 (Thu, 24 Aug 2006)
New Revision: 17792

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17792

Log:
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
Modified:
   branches/SAMBA_4_0/source/nbt_server/nbt_server.h
   branches/SAMBA_4_0/source/nbt_server/wins/winsclient.c


Changeset:
Modified: branches/SAMBA_4_0/source/nbt_server/nbt_server.h
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/nbt_server.h   2006-08-24 11:13:13 UTC 
(rev 17791)
+++ branches/SAMBA_4_0/source/nbt_server/nbt_server.h   2006-08-24 11:24:06 UTC 
(rev 17792)
@@ -39,7 +39,7 @@
 
        /* if registered with a wins server, then this lists the server being
           used */
-       char *wins_server;
+       const char *wins_server;
 };
 
 

Modified: branches/SAMBA_4_0/source/nbt_server/wins/winsclient.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winsclient.c      2006-08-24 
11:13:13 UTC (rev 17791)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winsclient.c      2006-08-24 
11:24:06 UTC (rev 17792)
@@ -111,7 +111,11 @@
        /* 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 @@
        /* 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);
 

Reply via email to