Changeset 14488


Ignore:
Timestamp:
Apr 5, 2015, 6:39:06 AM (6 years ago)
Author:
mikedld
Message:

#5920: Fix memory leak and access to freed memory in tr_getDefaultConfigDir (patch by jyelloz)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform.c

    r14382 r14488  
    331331          s = tr_buildPath (buf, appname, NULL);
    332332#else
    333           if ((s = tr_env_get_string ("XDG_CONFIG_HOME", NULL)))
    334             {
    335               s = tr_buildPath (s, appname, NULL);
    336               tr_free (s);
     333          char * const xdg_config_home = tr_env_get_string ("XDG_CONFIG_HOME", NULL);
     334          if (xdg_config_home != NULL)
     335            {
     336              s = tr_buildPath (xdg_config_home, appname, NULL);
     337              tr_free (xdg_config_home);
    337338            }
    338339          else
Note: See TracChangeset for help on using the changeset viewer.