Fixed a memory leak (thanks, Zack!).
authorRyan C. Gordon <icculus@icculus.org>
Sun, 07 Jun 2015 17:54:39 -0400
changeset 9712 a964d651f1dd
parent 9711 0a329b2a297f
child 9713 42877ed9b1c5
Fixed a memory leak (thanks, Zack!). We should probably rework this piece of code a little more after 2.0.4 ships, though. Fixes Bugzilla #3004.
src/core/linux/SDL_ibus.c
--- a/src/core/linux/SDL_ibus.c	Sat Jun 06 22:45:22 2015 -0400
+++ b/src/core/linux/SDL_ibus.c	Sun Jun 07 17:54:39 2015 -0400
@@ -461,10 +461,12 @@
             return SDL_FALSE;
         }
         
+        /* !!! FIXME: if ibus_addr_file != NULL, this will overwrite it and leak (twice!) */
         ibus_addr_file = SDL_strdup(addr_file);
         
         addr = IBus_ReadAddressFromFile(addr_file);
         if (!addr) {
+            SDL_free(addr_file);
             return SDL_FALSE;
         }