Skip to content
Snippets Groups Projects
  • Tom Tromey's avatar
    ee75ca6b
    libcc1: fix a memory leak · ee75ca6b
    Tom Tromey authored
    libcc1 has a memory leak when calling fork_exec -- it allocates a new
    vector of arguments, but then does not free it anywhere.  This patch
    changes this code to use std::vector instead.
    
    Note that the previous code tried to avoid bad_alloc.  I don't believe
    this is very important.  For one thing, plenty of other allocations do
    not bother with this.
    
    libcc1
    
    	* gdbctx.hh (do_compile): Use std::vector.
    
    
    ee75ca6b
    History
    libcc1: fix a memory leak
    Tom Tromey authored
    libcc1 has a memory leak when calling fork_exec -- it allocates a new
    vector of arguments, but then does not free it anywhere.  This patch
    changes this code to use std::vector instead.
    
    Note that the previous code tried to avoid bad_alloc.  I don't believe
    this is very important.  For one thing, plenty of other allocations do
    not bother with this.
    
    libcc1
    
    	* gdbctx.hh (do_compile): Use std::vector.