CppCheck is calling this "Memory leak: ptr" on the line marked "****" below. The purpose of the function is to create and object and return it, so it's okay that it doesn't delete the object that is created. Is that all that CppCheck is reacting to? Weird then that it was on that line and not the others. Or is there something else it is saying? Thank you. Dir* Fpopendir( const char* DirName ) { Dir* result = NULL; int FD = 0; Stat st; Dir* ptr = NULL; if ( fpstat( (char*) DirName, st ) < 0 ) return...
CppCheck is calling this "Memory leak: ptr" on the line marked "****" below. The purpose of the function is to create and object and return it, so it's okay that it doesn't delete the object that is created. Is that all that CppCheck is reacting to? Weird then that it was on that line and not the others. Or is there something else it is saying? Thank you. Dir* Fpopendir( const char* DirName ) { Dir* result = NULL; int FD = 0; Stat st; Dir* ptr = NULL; if ( fpstat( (char*) DirName, st ) < 0 ) return...