bugCERTI - Bugs: bug #24538, Cannot delete[] result from...

 
 

bug #24538: Cannot delete[] result from RTI::getXXXName()

Submitted by:  Petr Gotthard <gotthardp>
Submitted on:  Sun 12 Oct 2008 04:33:00 PM UTC  
 
Category: CERTISeverity: 4 - Important
Item Group: HLA compliance errorStatus: Ready For Test
Privacy: PublicAssigned to: Petr Gotthard <gotthardp>
Open/Closed: ClosedRelease: CVS
Reproducibility: IntermittentFixed Release: 3.3.2

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 13 Oct 2008 09:39:42 AM UTC, comment #2:

Done.

There is another benefit: We now correctly throw RTIinternalError when the new[] fails.

Petr Gotthard <gotthardp>
Project MemberIn charge of this item.
Mon 13 Oct 2008 07:52:25 AM UTC, comment #1:

No problem for me go ahead.
In fact no malloc/free should appear in C++ code
unless you want to do some oddities like
the one done in libHLA :-)

It may be useful to keep using new/delete in order to
be able to overload them :=)
(Imagine you want to embbed CERTI ...)

Eric NOULARD <erk>
Project Administrator
Sun 12 Oct 2008 04:33:00 PM UTC, original submission:

The RTI::getXXXName() return strdup-ed value, but the HLA 1.3 standard says the value must be freed using delete[]. Valgrind reports delete[]-ing a strdup-ed string as an error.

Solution: replace strdup() by new char[].

Petr Gotthard <gotthardp>
Project MemberIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 29 Apr 2009 09:11:06 AM UTCerkOpen/ClosedOpen=>Closed
      Fixed ReleaseNextRelease=>3.3.2
    Wed 29 Oct 2008 05:00:58 PM UTCerkDependencies-=>bugs #24691 is dependent
    Mon 13 Oct 2008 09:39:42 AM UTCgotthardpStatusIn Progress=>Ready For Test

    Back to the top


    Powered by Savane 3.1-cleanup1