[Coin-lpsolver] Mismatch new[]/malloc vs free in Coin/CoinMpsIO.cpp

John J Forrest jjforre at us.ibm.com
Thu Jan 19 17:42:05 EST 2006


benoit,

Thanks - will fix

John Forrest



Benoit SIBAUD <benoit.sibaud at rd.francetelecom.com> 
Sent by: coin-lpsolver-bounces at list.coin-or.org
01/19/2006 04:41 AM

To
coin-lpsolver at list.coin-or.org
cc

Subject
[Coin-lpsolver] Mismatch new[]/malloc vs free in Coin/CoinMpsIO.cpp






Hi,

In Coin/CoinMpsIO.cpp, reported by valgrind on clp test exe, "Mismatched
free() / delete / delete []":

CoinMpsIO::copyInIntegerInformation(const char * integerType)
{
  if (integerType) {
    if (!integerType_)
      integerType_ = new char [numberColumns_];
    memcpy(integerType_,integerType,numberColumns_);
  } else {
    delete [] integerType_;
    integerType_=NULL;
  }
}
(...)
void CoinMpsIO::freeAll()
{
(...)
  free(integerType_);
(...)
}
int CoinMpsIO::readMps(int & numberSets,CoinSet ** &sets)
{
(...)
    if (numberColumns_)
      integerType_ = (char *) malloc (numberColumns_*sizeof(char));
    else
      integerType_ = (char *) malloc (sizeof(char));
(...)
}

Regards,

-- 
Benoît Sibaud
_______________________________________________
Coin-lpsolver mailing list
Coin-lpsolver at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-lpsolver

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20060119/7b9a359b/attachment.html>


More information about the Clp mailing list