gnebehay / OpenTLD

A C++ implementation of OpenTLD
http://gnebehay.github.com/OpenTLD/
GNU General Public License v3.0
460 stars 196 forks source link

More mem leaks #29

Closed sharmanjagadeesan closed 10 years ago

sharmanjagadeesan commented 11 years ago

I have browsed through the code to detect mem. leaks etc. because my app crashed every once in a while. Basically what I did was that I looked for:

'new' 'new[]', 'malloc', 'calloc', and checked that there were 'delete', 'delete[]', 'free', 'free', respectively.

In many parts of the code I detected these kinds of problems:

void fnct() { this->a = new char[N]; }

where fnct() was called repetively. This causes mem. leaks. Instead it must be

void fnct() { if(this->a != NULL) { delete[] a; }

this->a = new char[N]; }

I can pin point the places or even share the code when I am confident that the code, with my modifications, is safe.

ghost commented 11 years ago

Have those changes been applied to the most recent version on github ? If not, sharmanjagadeesan, could you publish them somewhere on GitHub or SF.net ?

gnebehay commented 11 years ago

No changes have been made in this direction. If you have a pull request, then I would happily merge the changes.

kornerc commented 10 years ago

12e95dfbee7ab98a5b1c4b5039dde3774a643210