[Coin-discuss] Possible Memory Leak in OsiGlpk

Brady Hunsaker hunsaker at engr.pitt.edu
Fri Jun 24 10:47:04 EDT 2005


Thanks for catching these leaks, Joseph.  They're now corrected.

Brady

Joseph Young wrote:
> Hi,
> 	On line 1683:
> 
> int *columnIndicesPlus1 = new int[num+1];
> 
> columnIndicesPlus1 is declared as a pointer with memory allocated to it.  
> However, this memory is never deallocated with the delete operator.
> 
> 	This also occurs on lines
> 1787 with rowIndicesPlus1
> 1965 with index_adj
> 1966 with value_adj
> 
> 	In older versions of COIN, this wasn't an issue because these 
> arrays were declared using variable size array bounds.  This was not ISO 
> C++ compatible, so the code was changed to allocate memory dynamically.  
> It looks like the deallocation was just missed.
> 
> Sinc, Joseph Young
> 
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss




More information about the Coin-discuss mailing list