]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - test.c
Eeasy fix for that
[xonotic/gmqcc.git] / test.c
diff --git a/test.c b/test.c
index cdb90415f4ed8532ae067b0ccb2a632206b33f59..8751fd5798196225ecd0002786946da082184403 100644 (file)
--- a/test.c
+++ b/test.c
@@ -110,8 +110,7 @@ static FILE ** task_popen(const char *command, const char *mode) {
         data->handles[2] = fdopen(errhandle[0], mode);
 
         /* sigh */
-        if (argv)
-            vec_free(argv);
+        vec_free(argv);
         return data->handles;
     } else if (data->pid == 0) {
         /* child */
@@ -639,6 +638,7 @@ static void task_template_destroy(task_template_t **tmpl) {
      * Nullify all the template members otherwise NULL comparision
      * checks will fail if tmpl pointer is reused.
      */
+    mem_d((*tmpl)->tempfilename);
     mem_d(*tmpl);
 }
 
@@ -694,6 +694,7 @@ static bool task_propagate(const char *curdir, size_t *pad, const char *defs) {
             char            *qcflags = NULL;
             task_t           task;
 
+            task.compiled = false;
             util_debug("TEST", "compiling task template: %s/%s\n", curdir, files->d_name);
             found ++;
             if (!tmpl) {
@@ -706,7 +707,7 @@ static bool task_propagate(const char *curdir, size_t *pad, const char *defs) {
              * so we don't trample over an existing one.
              */
             tmpl->tempfilename = NULL;
-            util_asprintf(&tmpl->tempfilename, "%s/TMPDAT.%s", curdir, files->d_name);
+            util_asprintf(&tmpl->tempfilename, "%s/TMPDAT.%s.dat", curdir, files->d_name);
 
             /*
              * Additional QCFLAGS enviroment variable may be used
@@ -896,7 +897,7 @@ static void task_destroy(void) {
             else
                 util_debug("TEST", "removed stderr log file: %s\n", task_tasks[i].stderrlogfile);
 
-            remove(task_tasks[i].tmpl->tempfilename);
+            (void)!remove(task_tasks[i].tmpl->tempfilename);
         }
 
         /* free util_strdup data for log files */