bugCERTI - Bugs: bug #23150, Memory leak in Message::getAHVPS

 
 

bug #23150: Memory leak in Message::getAHVPS

Submitter:  Petr Gotthard <gotthardp>
Submitted:  Sat 03 May 2008 02:49:36 PM UTC
   
 
Category:  CERTI Severity:  * 3 - Normal
Item Group:  Software error Status:  Fixed
Privacy:  Public Assigned to:  erk
Open/Closed:  Closed Release:  * CVS
Reproducibility:  Every Time Fixed Release:  * 3.3.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 03 May 2008 08:15:02 PM UTC, comment #1: 

OK too.
Just checked-in.

Concerning mismatch between free/malloc, new/delete, new[]/delete[]
when they occurs on char* if you ever get a chance to
make the code work with std::string just do it.

std::string are so much safer to use.
They may be a performance bottleneck when frequently
created/destroyed/concat etc...
but most of our usage of string-like object
are not in a tight loop.

So the rule may be if it's easy and safe to get rid
of char* go ahead.

The only area we should keep char* is in the normative
HLA 1.3 API.
(or whenever we discover they really are a performance
bottleneck.



Eric NOULARD <erk>
Group administrator
Sat 03 May 2008 02:49:36 PM UTC, original submission:  

There is a memory leak in getAHVPS: getValue returns returns pointer to new value (and expects user to free it).

Additionaly, the _FEDid in FederationManagement is allocated with new[], but deleted with a plain delete.

Patch attached.

Petr Gotthard <gotthardp>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #15597:  leaks.diff added by gotthardp (860B - text/x-patch - bugfix)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by erk (Posted a comment)
  • -email is unavailable- added by gotthardp (Submitted the item)
  •  

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-07-02 erk Open/ClosedOpen Closed
        Fixed ReleaseCVS 3.3.0
    2008-05-03 erk StatusNone Fixed
        Assigned toNone erk
        Fixed ReleaseUnknown CVS
    2008-05-03 gotthardp Attached File- Added leaks.diff, #15597

    Back to the top

    Powered by Savane 3.13-081f.
    Corresponding source code