[jit] Fix memory leak within diagnostic.c

2014-10-03 Thread David Malcolm
Committed to branch dmalcolm/jit: Running e.g. test-factorial.exe under valgrind shows that libgccjit.so was leaking ~13.5KB of RAM per invocation of the compiler here: ==57074== 21,440 bytes in 4 blocks are definitely lost in loss record 896 of 907 ==57074==at 0x4A0645D: malloc (in

RE: [jit] Fix memory leak within diagnostic.c

2014-10-03 Thread Manuel López-Ibáñez
gcc/ChangeLog.jit: * diagnostic.c (diagnostic_finish): Free the memory for context-classify_diagnostic and context-printer, running the destructor for the latter. It would be easier to review and merge your branch if you directly propose these self-contained and generally useful