From 125d039e3d2ee0779a1329f8767a0993e294a45f Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Fri, 21 Jun 2013 23:16:00 +0000 Subject: [PATCH] Fix some bugs --- exec.c | 4 +++- parser.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/exec.c b/exec.c index 05d6d8d..dccee5e 100644 --- a/exec.c +++ b/exec.c @@ -56,7 +56,7 @@ qc_program* prog_load(const char *filename, bool skipversion) { qc_program *prog; prog_header header; - FILE *file = fs_file_open(filename, "rb"); + FILE *file = fs_file_open(filename, "rb"); if (!file) return NULL; @@ -144,6 +144,8 @@ error: vec_free(prog->entitydata); vec_free(prog->entitypool); mem_d(prog); + + fs_file_close(file); return NULL; } diff --git a/parser.c b/parser.c index 03b8a86..14f7803 100644 --- a/parser.c +++ b/parser.c @@ -6303,8 +6303,9 @@ parser_t *parser_create() vec_push(parser->correct_variables, correct_trie_new()); vec_push(parser->correct_variables_score, NULL); - empty_ctx.file = ""; - empty_ctx.line = 0; + empty_ctx.file = ""; + empty_ctx.line = 0; + empty_ctx.column = 0; parser->nil = ast_value_new(empty_ctx, "nil", TYPE_NIL); parser->nil->cvq = CV_CONST; if (OPTS_FLAG(UNTYPED_NIL)) -- 2.39.2