
Dear Luigi Mantellini,
In message AANLkTi=KQ+zc7yVUe5ssc=wzZuWEcPMYQHq-c-HZ0joa@mail.gmail.com you wrote:
my pov is different: free should (must) be called only on already allocated pointers. I know that free code checks at begin if ptr is null or not. Anyway I don't understand why a null pointer check before to call free cannot be added to the code... it's safe and follows the logical flow of the code.
I received warning from my debugger during activities on other things, and I added this fix to my code to turn-off "possible free on null pointer" warning from my debugger.
free(NULL) has a well defined behaviour: "If ptr is NULL, no operation is performed."
Seems your debugger is over-cautious. This may be OK for debugging, but is no good reason to change the code.
Best regards,
Wolfgang Denk