[Coin-ipopt] Re: memory leak in ipopt c interface

Andreas Waechter andreasw at watson.ibm.com
Tue Jun 8 10:11:21 EDT 2004


Hi Peter,

Many thanks for letting me know about the memory leak.  I fixed it, the
corrected file will be in tomorrow's tarball.

Thanks again and best regards,

Andreas

On Tue, 8 Jun 2004, Peter Sturdza wrote:

> Andreas,
>
> I just started using IPOPT and installed the tarball
> marked 2004Jun05.
>
> I believe there is an error in the Ipopt_Destroy
> routine in the file Ipopt_Interface.c.  The arrays
> args and cargs are not freed after having been
> allocated with calls to Ipopt_AddParam.
>
> Ipopt_Destroy should read something like:
> void Ipopt_Destroy(Ipopt problem)
> {
>   if (problem != NULL) {
>     if (problem->nlb > 0) {
>       free(problem->ilb);
>       free(problem->bnds_l);
>     }
>
>     if (problem->nub > 0) {
>       free(problem->iub);
>       free(problem->bnds_u);
>     }
>
>     if (problem->nargs_alloc > 0) {
>       free(problem->args);
>       free(problem->cargs);
>     }
>
>     free(problem);
>   }
> }
>
> Peter
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/
>




More information about the Coin-ipopt mailing list