So one major problem I have is determining whether a given function in C/C++ does memory allocation or not. I frequently work with external libraries, some of which have functions that return pointers to new objects. Is there some basic design paradigm or convention that will let me know ahead of time if something allocates memory?
It would seem like any function that returns a pointer to a new object must be allocating memory, but this does not always seem to be the case. For example, fopen does not
Edit: To be clear, I don't have access to the source code so I can't just check if it uses new or malloc, ect.