[AD] upath.c memory leak?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I accidentally was using upath.c on iOS and I think there's a memory leak. Here's a patch, someone running Linux may want to check and apply it.

diff --git a/src/unix/upath.c b/src/unix/upath.c
index fd421a1..eb97575 100644
--- a/src/unix/upath.c
+++ b/src/unix/upath.c
@@ -97,6 +97,7 @@ static ALLEGRO_PATH *_find_executable_file(const char *filenam

         if (stat(al_path_cstr(path, '/'), &finfo) == 0 &&
            !S_ISDIR (finfo.st_mode)) {
+            al_ustr_free(us);
            return path;
         }

@@ -104,6 +105,7 @@ static ALLEGRO_PATH *_find_executable_file(const char *filen

         start_pos = next_start_pos;
      }
+      al_ustr_free(us);
   }

   return NULL;

Trent



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/