Fix for MD5 leak bug, issue #7195 by lrodorigo · Pull Request #7197 · esp8266/Arduino

@lrodorigo

Added the free before the return.
I was wondering if a more "C++ish" resource handling could be fine for you (e.g. buffer as unique_ptr).

Fixes #7195

@luiss-mind

d-a-v

@devyte

@lrodorigo I wouldn't mind a unique_ptr solution at all, at the very least it would be one small step towards exception friendly code.

@devyte devyte linked an issue

Apr 8, 2020

that may be closed by this pull request

@devyte devyte linked an issue

Apr 8, 2020

that may be closed by this pull request

@d-a-v

@devyte

@lrodorigo ping? will you be reworking this with a smart ptr?

@lrodorigo

Sorry, I read quickly your message and I misunderstood your message.

I can try to rework for a smart_ptr, no-except code. I can start to work on it after easter holidays.

@devyte

@earlephilhower

@d-a-v

I can try to rework for a smart_ptr, no-except code. I can start to work on it after easter holidays.

That will be nice !
We are going to merge this fix now because it solves a bug,
then when you're ready you can post another pull request using unique_ptr<>