akrinke / Font-Stash

A dynamic font glyph cache for OpenGL.
114 stars 18 forks source link

Possible memory leak #7

Closed ghost closed 10 years ago

ghost commented 10 years ago

Hi,

One of our developers found a possible memory leak, caught when doing integration tests. Attached is the diff (viewable here: http://code.google.com/p/bitfighter/source/diff?spec=svn4604e38f9ee3b26453e306e2bf43c32d5ee52f13&r=4604e38f9ee3b26453e306e2bf43c32d5ee52f13&format=side&path=/fontstash/fontstash.c)

diff -r 775e2f415e84 -r 4604e38f9ee3 fontstash/fontstash.c
--- a/fontstash/fontstash.c Wed Nov 13 08:06:17 2013 -0600
+++ b/fontstash/fontstash.c Wed Nov 13 12:48:27 2013 -0600
@@ -196,6 +196,8 @@
        free(stash);
    if (texture != NULL)
        free(texture);
+   if (empty_data != NULL)
+       free(empty_data);
    return NULL;
 }
akrinke commented 10 years ago

Thank you very much for the report! I will apply the patch in the next few days.

ghost commented 10 years ago

Great, thanks!