Convert all uses of uint8/16/32 to _t in nmbd and the include file.
[samba.git] / source3 / nmbd / nmbd_serverlistdb.c
index 05ca6e9367fc5dfb9fafbf148a326a69ca33e951..b4057193b2f23b40fcc6ad3fac016cfaab4d5864 100644 (file)
@@ -183,7 +183,7 @@ void expire_servers(struct work_record *work, time_t t)
  out this server record from an earlier subnet.
 ******************************************************************/
 
-static uint32 write_this_server_name( struct subnet_record *subrec,
+static uint32_t write_this_server_name( struct subnet_record *subrec,
                                       struct work_record *work,
                                       struct server_record *servrec)
 {
@@ -221,7 +221,7 @@ static uint32 write_this_server_name( struct subnet_record *subrec,
  broadcast subnets.
 ******************************************************************/
 
-static uint32 write_this_workgroup_name( struct subnet_record *subrec, 
+static uint32_t write_this_workgroup_name( struct subnet_record *subrec,
                                          struct work_record *work)
 {
        struct subnet_record *ssub;
@@ -253,7 +253,7 @@ static uint32 write_this_workgroup_name( struct subnet_record *subrec,
   Write out the browse.dat file.
   ******************************************************************/
 
-void write_browse_list_entry(XFILE *fp, const char *name, uint32 rec_type,
+void write_browse_list_entry(XFILE *fp, const char *name, uint32_t rec_type,
                const char *local_master_browser_name, const char *description)
 {
        fstring tmp;
@@ -273,7 +273,7 @@ void write_browse_list(time_t t, bool force_write)
        struct server_record *servrec;
        char *fname;
        char *fnamenew;
-       uint32 stype;
+       uint32_t stype;
        int i;
        XFILE *fp;
        bool list_changed = force_write;
@@ -311,6 +311,7 @@ void write_browse_list(time_t t, bool force_write)
        fnamenew = talloc_asprintf(ctx, "%s.",
                                fname);
        if (!fnamenew) {
+               talloc_free(fname);
                return;
        }
 
@@ -319,6 +320,8 @@ void write_browse_list(time_t t, bool force_write)
        if (!fp) {
                DEBUG(0,("write_browse_list: Can't open file %s. Error was %s\n",
                        fnamenew,strerror(errno)));
+               talloc_free(fnamenew);
+               talloc_free(fname);
                return;
        }
 
@@ -331,6 +334,8 @@ void write_browse_list(time_t t, bool force_write)
                DEBUG(0,("write_browse_list: Fatal error - cannot find my workgroup %s\n",
                        lp_workgroup()));
                x_fclose(fp);
+               talloc_free(fnamenew);
+               talloc_free(fname);
                return;
        }
 
@@ -359,7 +364,7 @@ void write_browse_list(time_t t, bool force_write)
 
                /* Output server details, plus what workgroup they're in. */
                write_browse_list_entry(fp, my_netbios_names(i), stype,
-                       string_truncate(lp_serverstring(talloc_tos()), MAX_SERVER_STRING_LENGTH), lp_workgroup());
+                       string_truncate(lp_server_string(talloc_tos()), MAX_SERVER_STRING_LENGTH), lp_workgroup());
        }
 
        for (subrec = FIRST_SUBNET; subrec ; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) { 
@@ -367,7 +372,7 @@ void write_browse_list(time_t t, bool force_write)
 
                for (work = subrec->workgrouplist; work ; work = work->next) {
                        /* Write out a workgroup record for a workgroup. */
-                       uint32 wg_type = write_this_workgroup_name( subrec, work);
+                       uint32_t wg_type = write_this_workgroup_name( subrec, work);
 
                        if(wg_type) {
                                write_browse_list_entry(fp, work->work_group, wg_type,
@@ -378,7 +383,7 @@ void write_browse_list(time_t t, bool force_write)
                        /* Now write out any server records a workgroup may have. */
 
                        for (servrec = work->serverlist; servrec ; servrec = servrec->next) {
-                               uint32 serv_type;
+                               uint32_t serv_type;
 
                                /* We have already written our names here. */
                                if(is_myname(servrec->serv.name))
@@ -399,4 +404,6 @@ void write_browse_list(time_t t, bool force_write)
        chmod(fnamenew,0644);
        rename(fnamenew,fname);
        DEBUG(3,("write_browse_list: Wrote browse list into file %s\n",fname));
+       talloc_free(fnamenew);
+       talloc_free(fname);
 }