char **buf;
len = strlen(partial);
- buf = malloc(sizeofbuf + sizeof (char *));
+ buf = qmalloc(sizeofbuf + sizeof (char *));
// Loop through the alias list and print all matches
for (cmd = cmd_functions; cmd; cmd = cmd->next)
if (!strncasecmp(partial, cmd->name, len))
char **buf;
len = strlen(partial);
- buf = malloc(sizeofbuf + sizeof (char *));
+ buf = qmalloc(sizeofbuf + sizeof (char *));
// Loop through the alias list and print all matches
for (alias = cmd_alias; alias; alias = alias->next)
if (!strncasecmp(partial, alias->name, len))
}
for (i = 0; i < 3; i++)
if (list[i])
- free (list[i]);
+ qfree (list[i]);
}
Host_Error("NewWinding: too many points\n");
size = (int)((winding_t *)0)->points[points];
- w = malloc (size);
+ w = qmalloc (size);
memset (w, 0, size);
return w;
void FreeWinding (winding_t *w)
{
- free (w);
+ qfree (w);
}
/*
portal_t *AllocPortal (void)
{
portal_t *p;
- p = malloc(sizeof(portal_t));
+ p = qmalloc(sizeof(portal_t));
memset(p, 0, sizeof(portal_t));
p->chain = portalchain;
portalchain = p;
}
FreeWinding(p->winding);
}
- free(p);
+ qfree(p);
p = pnext;
}
}
}
*p = 0;
- file = calloc (sizeof (*file), 1);
+ file = qmalloc (sizeof (*file));
+ memset(file, 0, sizeof(*file));
if (!file)
return 0;
#ifdef HAVE_ZLIB
if (zip) {
file->gzfile = gzopen (path, m);
if (!file->gzfile) {
- free (file);
+ qfree (file);
return 0;
}
} else
{
file->file = fopen (path, m);
if (!file->file) {
- free (file);
+ qfree (file);
return 0;
}
}
*p = 0;
- file = calloc (sizeof (*file), 1);
+ file = qmalloc (sizeof (*file));
+ memset(file, 0, sizeof(*file));
if (!file)
return 0;
#ifdef HAVE_ZLIB
if (zip) {
file->gzfile = gzdopen (fd, m);
if (!file->gzfile) {
- free (file);
+ qfree (file);
return 0;
}
} else
{
file->file = fdopen (fd, m);
if (!file->file) {
- free (file);
+ qfree (file);
return 0;
}
}
else
gzclose (file->gzfile);
#endif
- free (file);
+ qfree (file);
}
int