Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Numerical Recipes Official Announcements > Official Bug Reports (NR3, the Third Edition)

Thread Tools Display Modes
Old 09-13-2011, 02:39 PM
Saul Teukolsky Saul Teukolsky is offline
Numerical Recipes Author
Join Date: Dec 2001
Posts: 211
memory leak in broydn.h

There are potential memory leaks in broydn.h: The second and third times that the statement
gets executed, the routine returns to the statement
qr=new QRdcmp(fdjac(x,fvec));
without deleting the old qr. The fix is to replace
QRdcmp *qr;
QRdcmp *qr=NULL;
and insert
delete qr;
before the statement
qr=new QRdcmp(fdjac(x,fvec));
Note that this bug will not cause incorrect results to be calculated, but may cause your program to crash if broydn is called many times with these side branches being taken often.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 01:49 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.