aco: fix file leak in ra_fail()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Aug 2020 07:41:46 +0000 (09:41 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 20 Aug 2020 14:42:07 +0000 (14:42 +0000)
Fixes: c2b1978aa47 ("aco: rework the way various compilation/validation errors are reported")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6399>

src/amd/compiler/aco_validate.cpp

index b109c41a72a5f47f65470ca9538914ae2a45b32e..0d74458519c488dc15fb0b4f2c0cc5b53cb4a887 100644 (file)
@@ -512,6 +512,7 @@ bool ra_fail(Program *program, Location loc, Location loc2, const char *fmt, ...
       aco_print_instr(loc2.instr, memf);
    }
    fprintf(memf, "\n\n");
       aco_print_instr(loc2.instr, memf);
    }
    fprintf(memf, "\n\n");
+   fclose(memf);
 
    aco_err(program, out);
    free(out);
 
    aco_err(program, out);
    free(out);