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

 
 

bug #23150: Memory leak in Message::getAHVPS

Submitted by:  Petr Gotthard <gotthardp>
Submitted on:  Sat 03 May 2008 02:49:36 PM UTC  
 
Category: CERTISeverity: 3 - Normal
Item Group: Software errorStatus: Fixed
Privacy: PublicAssigned to: Eric NOULARD <erk>
Open/Closed: ClosedRelease: CVS
Reproducibility: Every TimeFixed Release: 3.3.0

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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>
Project Member

 

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

Attach File(s):
   
   
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
  • -unavailable- added by erk (Posted a comment)
  • -unavailable- added by gotthardp (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 02 Jul 2008 08:57:42 AM UTCerkOpen/ClosedOpen=>Closed
      Fixed ReleaseCVS=>3.3.0
    Sat 03 May 2008 08:15:02 PM UTCerkStatusNone=>Fixed
      Assigned toNone=>erk
      Fixed ReleaseUnknown=>CVS
    Sat 03 May 2008 02:49:36 PM UTCgotthardpAttached File-=>Added leaks.diff, #15597

    Back to the top


    Powered by Savane 3.1-cleanup1