LeakFix is a safe memory-leak fixing tool for C programs. It builds procedure summaries based on pointer analysis results, uses the summaries to analyze each procedure seperately, and then generates fixes by inserting "free(..)" at certain program points.

LeakFix is integrated into LLVM infrastructure. Its analysis consists of two phases:

  • Compiling phase. In this phase, LeakFix works with LLVM C frontend Clang. It aims to record traces from LLVM IR to C source code. To achieve this, when Clang compiles each source file into LLVM bitcode file, LeakFix serializes the ASTs of source code, and generates trace files during compilation.
  • Linking phase. In this phase, LeakFix works with GNU gold linker and LLVM gold plugin. After GNU gold linker has finished linking all LLVM bitcode files with LLVM gold plugin, LeakFix deserializes AST and bitcode files, recovers the traces, analyzes the whole program, and generates fixed source files.





Contributors to LeakFix implementation are:

Tool References

HTML style inspired from Fastcheck