Fix a memory leak.

The command hash table is shared between all progs engine instances, but it
was being allocated for every instance. Ensure only one is allocated.
This commit is contained in:
Bill Currie 2011-07-05 19:05:24 +09:00
parent 6484dd16c7
commit a8245e598e

View file

@ -164,7 +164,8 @@ RUA_Cmd_Init (progs_t *pr, int secure)
res->cmds = 0;
PR_Resources_Register (pr, "Cmd", res, bi_cmd_clear);
bi_cmds = Hash_NewTable (1021, bi_cmd_get_key, bi_cmd_free, 0);
if (!bi_cmds)
bi_cmds = Hash_NewTable (1021, bi_cmd_get_key, bi_cmd_free, 0);
PR_RegisterBuiltins (pr, builtins);
}