From: fennecdjay Date: Wed, 9 Oct 2019 18:50:02 +0000 (+0200) Subject: :bomb: Fix compile file leak X-Git-Tag: nightly~2198^2~77 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=faeb03078c82e97c570336e7f48093a160f4e884;p=gwion.git :bomb: Fix compile file leak --- diff --git a/src/compile.c b/src/compile.c index 04615afe..991761f1 100644 --- a/src/compile.c +++ b/src/compile.c @@ -53,7 +53,8 @@ static inline void compiler_error(MemPool p, const struct Compiler* c) { static void compiler_clean(MemPool p, const struct Compiler* c) { if(c->name) xfree(c->name); - if(c->type == COMPILE_MSTR && c->file) + /* test c->type because COMPILE_FILE does not own file */ + if(c->type != COMPILE_FILE && c->file) fclose(c->file); if(c->ast) free_ast(p, c->ast);