Fixed a memory leak (thanks, Zack!).
authorRyan C. Gordon <icculus@icculus.org>
Sun, 07 Jun 2015 17:54:39 -0400
changeset 9712a964d651f1dd
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
     1.1 --- a/src/core/linux/SDL_ibus.c	Sat Jun 06 22:45:22 2015 -0400
     1.2 +++ b/src/core/linux/SDL_ibus.c	Sun Jun 07 17:54:39 2015 -0400
     1.3 @@ -461,10 +461,12 @@
     1.4              return SDL_FALSE;
     1.5          }
     1.6          
     1.7 +        /* !!! FIXME: if ibus_addr_file != NULL, this will overwrite it and leak (twice!) */
     1.8          ibus_addr_file = SDL_strdup(addr_file);
     1.9          
    1.10          addr = IBus_ReadAddressFromFile(addr_file);
    1.11          if (!addr) {
    1.12 +            SDL_free(addr_file);
    1.13              return SDL_FALSE;
    1.14          }
    1.15