Fix some bugs

This commit is contained in:
Dale Weiler 2013-06-21 23:16:00 +00:00
parent 6db2e69f9a
commit 125d039e3d
2 changed files with 6 additions and 3 deletions

4
exec.c
View file

@ -56,7 +56,7 @@ qc_program* prog_load(const char *filename, bool skipversion)
{ {
qc_program *prog; qc_program *prog;
prog_header header; prog_header header;
FILE *file = fs_file_open(filename, "rb"); FILE *file = fs_file_open(filename, "rb");
if (!file) if (!file)
return NULL; return NULL;
@ -144,6 +144,8 @@ error:
vec_free(prog->entitydata); vec_free(prog->entitydata);
vec_free(prog->entitypool); vec_free(prog->entitypool);
mem_d(prog); mem_d(prog);
fs_file_close(file);
return NULL; return NULL;
} }

View file

@ -6303,8 +6303,9 @@ parser_t *parser_create()
vec_push(parser->correct_variables, correct_trie_new()); vec_push(parser->correct_variables, correct_trie_new());
vec_push(parser->correct_variables_score, NULL); vec_push(parser->correct_variables_score, NULL);
empty_ctx.file = "<internal>"; empty_ctx.file = "<internal>";
empty_ctx.line = 0; empty_ctx.line = 0;
empty_ctx.column = 0;
parser->nil = ast_value_new(empty_ctx, "nil", TYPE_NIL); parser->nil = ast_value_new(empty_ctx, "nil", TYPE_NIL);
parser->nil->cvq = CV_CONST; parser->nil->cvq = CV_CONST;
if (OPTS_FLAG(UNTYPED_NIL)) if (OPTS_FLAG(UNTYPED_NIL))