mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
close a nasty hole in the gamedir code
This commit is contained in:
parent
9537640b1c
commit
efd6ccff02
1 changed files with 8 additions and 2 deletions
|
@ -352,6 +352,12 @@ qfs_dir_get_key (void *_k, void *unused)
|
||||||
return _k;
|
return _k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
qfs_dir_free (void *_k, void *unused)
|
||||||
|
{
|
||||||
|
free (_k);
|
||||||
|
}
|
||||||
|
|
||||||
static plitem_t *
|
static plitem_t *
|
||||||
qfs_find_gamedir (const char *name, hashtab_t *dirs)
|
qfs_find_gamedir (const char *name, hashtab_t *dirs)
|
||||||
{
|
{
|
||||||
|
@ -401,7 +407,7 @@ qfs_build_gamedir (const char **list)
|
||||||
gamedir_t *gamedir;
|
gamedir_t *gamedir;
|
||||||
plitem_t *gdpl;
|
plitem_t *gdpl;
|
||||||
dstring_t *path;
|
dstring_t *path;
|
||||||
hashtab_t *dirs = Hash_NewTable (31, qfs_dir_get_key, 0, 0);
|
hashtab_t *dirs = Hash_NewTable (31, qfs_dir_get_key, qfs_dir_free, 0);
|
||||||
hashtab_t *vars = qfs_new_vars ();
|
hashtab_t *vars = qfs_new_vars ();
|
||||||
const char *dir = 0;
|
const char *dir = 0;
|
||||||
|
|
||||||
|
@ -455,7 +461,7 @@ qfs_build_gamedir (const char **list)
|
||||||
Sys_Printf ("gamedir `%s' not found\n", name);
|
Sys_Printf ("gamedir `%s' not found\n", name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Hash_Add (dirs, (void *) name);
|
Hash_Add (dirs, strdup (name));
|
||||||
if (!j) {
|
if (!j) {
|
||||||
gamedir->name = strdup (name);
|
gamedir->name = strdup (name);
|
||||||
gamedir->gamedir = strdup (list[j]);
|
gamedir->gamedir = strdup (list[j]);
|
||||||
|
|
Loading…
Reference in a new issue