]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Fix some bugs
authorDale Weiler <killfieldengine@gmail.com>
Fri, 21 Jun 2013 23:16:00 +0000 (23:16 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Fri, 21 Jun 2013 23:16:00 +0000 (23:16 +0000)
exec.c
parser.c

diff --git a/exec.c b/exec.c
index 05d6d8df1a6dd0701650cc5d866a755c9907d20e..dccee5ed121205936fd05c2c9804dea8d6381cab 100644 (file)
--- 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;
 }
 
index 03b8a8677bf3bf14f72bfab2e14affa51e2b2229..14f78035004e07c9689ec6e8b54fab451be5342c 100644 (file)
--- 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 = "<internal>";
-    empty_ctx.line = 0;
+    empty_ctx.file   = "<internal>";
+    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))