Menu

#541 Mismatching allocation and deallocation in soudlow.cc

applied_to_SVN
closed
None
1
2019-01-02
2019-01-02
No

A memory allocated with "new audio_buffer_t" is then deallocated with "delete []". According to stackoverflow, this is an undefined behaviour. Detected with cppcheck. Patch attached.

1 Attachments

Discussion

  • Stanislav Shwartsman

    Hello, I applied the patch because teh code was definitelly wrong before.
    But the code around still looks very fishy.
    I would suggest to Volker to check:
    Why any new or delete is used here at all. both inbuffer and outbuffer may be local variables here and not new'ed and deleted few lines of code later.
    The following memory seems like never freed:
    inbuffer->fdata = new float[len1];
    May be am wrong, the memory alocations look really crazy, but this defintelly could be a memleak here ...

     
  • Stanislav Shwartsman

    • status: open --> accepted
    • assigned_to: Volker Ruppert
    • Group: to_be_validated --> applied_to_SVN
     
  • Stanislav Shwartsman

    • status: accepted --> closed
     

Log in to post a comment.