This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
void remove_name_from_namelist(struct subnet_record *subrec,
struct name_record *namerec )
{
- if (subrec == wins_server_subnet) {
+ if (subrec == wins_server_subnet)
remove_name_from_wins_namelist(namerec);
- return;
- }
-
- subrec->namelist_changed = True;
+ else {
+ subrec->namelist_changed = True;
+ DLIST_REMOVE(subrec->namelist, namerec);
+ }
- DLIST_REMOVE(subrec->namelist, namerec);
SAFE_FREE(namerec->data.ip);
ZERO_STRUCTP(namerec);
SAFE_FREE(namerec);
if( self_only && (name_ret->data.source != SELF_NAME) && (name_ret->data.source != PERMANENT_NAME) ) {
DEBUG( 9, ( "find_name_on_subnet: on subnet %s - self name %s NOT FOUND\n",
subrec->subnet_name, nmb_namestr(nmbname) ) );
- return False;
+ return NULL;
}
DEBUG( 9, ("find_name_on_subnet: on subnet %s - found name %s source=%d\n",
x_fprintf(fp,"Source = %s\nb_flags = %x\t", src_type, namerec->data.nb_flags);
if(namerec->data.death_time != PERMANENT_TTL) {
+ const char *asct;
tm = localtime(&namerec->data.death_time);
- x_fprintf(fp, "death_time = %s\t", asctime(tm));
+ if (!tm) {
+ return;
+ }
+ asct = asctime(tm);
+ if (!asct) {
+ return;
+ }
+ x_fprintf(fp, "death_time = %s\t", asct);
} else {
x_fprintf(fp, "death_time = PERMANENT\t");
}
if(namerec->data.refresh_time != PERMANENT_TTL) {
+ const char *asct;
tm = localtime(&namerec->data.refresh_time);
- x_fprintf(fp, "refresh_time = %s\n", asctime(tm));
+ if (!tm) {
+ return;
+ }
+ asct = asctime(tm);
+ if (!asct) {
+ return;
+ }
+ x_fprintf(fp, "refresh_time = %s\n", asct);
} else {
x_fprintf(fp, "refresh_time = PERMANENT\n");
}