CTryCatch icon indicating copy to clipboard operation
CTryCatch copied to clipboard

Possible memory leak on `__ctrycatch_exception_message`

Open Jamesits opened this issue 9 years ago • 2 comments

There are no way to tell if __ctrycatch_exception_message is hardcoded or allocated in runtime.

Jamesits avatar Jan 03 '16 15:01 Jamesits

You can do two things. One is more elegant for the user (the second one) and one is more elegant in your code :

  • add an optional third parameter for throw macro, being the "free" function to be used on the string at the end of its life (like, the appearance of the finally)

  • use the signal function on SEGFAULT signal and try to free it, then just set the signal function back to NULL

I think that it should be the user that should free it though, if the throw can be catch that is

Klevh avatar Jan 25 '18 08:01 Klevh

I can help, I am working on the same project ^^ ( https://github.com/Klevh/Exsee )

Klevh avatar Jan 25 '18 08:01 Klevh