malloc'ed char-string gets delete[]d

Issue #258 closed
Former user created an issue

Originally reported on Google Code with ID 258

While studying the source code (pulled from github), I found that the 
char* buffer in _doFormat() is created using the C-style malloc() 
allocator, but is destroyed in operator<<() using the C++-style delete[] 
deallocator. This asymmetry is really bad and should be fixed, either by 
using new[] in the first place or free() in the second.

Reported by andreas_scherer@alice.de on 2009-02-21 07:58:49

Comments (6)

  1. Former user Account Deleted

    ``` Also affected, core/evaluator.cpp: operator<<() calls HMath::formatFixed and delete[]s the result. ```

    Reported by `andreas_scherer@alice.de` on 2009-02-21 08:47:48

  2. Former user Account Deleted

    ``` Code change applied. ```

    Reported by `andreas_scherer@alice.de` on 2009-02-22 19:22:12 - Status changed: `Fixed` - Labels added: Type-Defect, Priority-Medium

  3. Former user Account Deleted

    Reported by `helder.pereira.correia` on 2009-02-22 19:32:38 - Labels added: Milestone-0.11

  4. Log in to comment