pservice->szService));
string_free(&pservice->szService);
- if (pservice->copymap)
- {
- free(pservice->copymap);
- pservice->copymap = NULL;
- }
+ SAFE_FREE(pservice->copymap);
for (i = 0; parm_table[i].label; i++)
{
f->name = strdup(fname);
if (!f->name)
{
- free(f);
+ SAFE_FREE(f);
return;
}
f->subfname = strdup(subfname);
if (!f->subfname)
{
- free(f);
+ SAFE_FREE(f);
return;
}
file_lists = f;
("file %s modified: %s\n", n2,
ctime(&mod_time)));
f->modtime = mod_time;
- free(f->subfname);
+ SAFE_FREE(f->subfname);
f->subfname = strdup(n2);
return (True);
}
static void init_copymap(service * pservice)
{
int i;
- if (pservice->copymap)
- free(pservice->copymap);
+ SAFE_FREE(pservice->copymap);
pservice->copymap = (BOOL *)malloc(sizeof(BOOL) * NUMPARAMETERS);
if (!pservice->copymap)
DEBUG(0,
lp_add_home(p, homes, home);
}
}
- free(s);
+ SAFE_FREE(s);
}
/***************************************************************************
rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1)));
if (!rlist) {
DEBUG(0,("lp_list_make: Unable to allocate memory"));
- lp_list_free (&list);
- free (s);
+ lp_list_free(&list);
+ SAFE_FREE(s);
return NULL;
}
else list = rlist;
list[num] = strdup(tok);
if (!list[num]) {
DEBUG(0,("lp_list_make: Unable to allocate memory"));
- lp_list_free (&list);
- free (s);
+ lp_list_free(&list);
+ SAFE_FREE(s);
return NULL;
}
num++;
}
- free (s);
+ SAFE_FREE(s);
return list;
}
rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1)));
if (!rlist) {
DEBUG(0,("lp_list_copy: Unable to allocate memory"));
- lp_list_free (&list);
+ lp_list_free(&list);
return False;
}
else list = rlist;
list[num] = strdup(src[num]);
if (!list[num]) {
DEBUG(0,("lp_list_copy: Unable to allocate memory"));
- lp_list_free (&list);
+ lp_list_free(&list);
return False;
}
if (!list || !*list) return;
tlist = *list;
- for(; *tlist; tlist++) free(*tlist);
- free (*list);
- *list = NULL;
+ for(; *tlist; tlist++) SAFE_FREE(*tlist);
+ SAFE_FREE(*list);
}
BOOL lp_list_substitute(char **list, const char *pattern, const char *insert)
}
memcpy(t, *list, d);
memcpy(t +d +li, p +lp, ls -d -lp +1);
- free (*list);
+ SAFE_FREE(*list);
*list = t;
ls += ld;
s = t +d +li;
static void myfile_close(myFILE *f)
{
if (!f) return;
- if (f->buf) free(f->buf);
- free(f);
+ SAFE_FREE(f->buf);
+ SAFE_FREE(f);
}
/* -------------------------------------------------------------------------- **
DEBUG( lvl,
("%s Unable to open configuration file \"%s\":\n\t%s\n",
func, FileName, strerror(errno)) );
- free(ret);
+ SAFE_FREE(ret);
return NULL;
}
return( False );
}
result = Parse( InFile, sfunc, pfunc );
- free( bufr );
+ SAFE_FREE( bufr );
bufr = NULL;
bSize = 0;
}