New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark freed pointer to NULL in wrapper for u_free() #30
Comments
Implemented as discussed at Issue 30. The details can be found at: Openwsman#30
Hi Klaus, Related to the memory leaks. We are analyzing this report. It would be great if you can help us finding the potential memory leaks. Executed a WS-Man command that has one instance and nearly 60 properties: Entries in Generated Report: |
src/lib/wsman-server.c:104@2times looks harmless. That's the plugin initialization at startup. Memory should be freed at teardown. But the operating system will also take care of this when the process exits |
src/lib/u/list.c:233 - uhm, that's the create function and its purpose is to malloc. It's the callers responsibility to free memory. You might be better off with using valgrind (http://valgrind.org/) which does a full coverage |
As u_free is a wrapper function, so i think it would be a good idea to mark the freed pointer to NULL.
The advantages can be:
Fix Description:-
File Name: memory.c
Path: src/lib/u/memory.c
Macro: u_free
/** \brief Wrapper for free(3), sanity checks the supplied pointer */
define u_free(ptr) if(ptr){free(ptr);ptr=NULL;}
The text was updated successfully, but these errors were encountered: