Ignore:
Timestamp:
May 9, 2015, 11:56:35 AM (6 years ago)
Author:
mikedld
Message:

Fix some issues revealed by coverity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r14524 r14526  
    460460{
    461461  char * filename;
     462  tr_variant oldDict;
    462463  tr_variant fileSettings;
    463   tr_variant sessionDefaults;
    464   tr_variant tmp;
    465464  bool success;
    466465  tr_error * error = NULL;
     
    470469  /* initializing the defaults: caller may have passed in some app-level defaults.
    471470   * preserve those and use the session defaults to fill in any missing gaps. */
    472   tr_variantInitDict (&sessionDefaults, 0);
    473   tr_sessionGetDefaultSettings (&sessionDefaults);
    474   tr_variantMergeDicts (&sessionDefaults, dict);
    475   tmp = *dict;
    476   *dict = sessionDefaults;
    477   sessionDefaults = tmp;
     471  oldDict = *dict;
     472  tr_variantInitDict (dict, 0);
     473  tr_sessionGetDefaultSettings (dict);
     474  tr_variantMergeDicts (dict, &oldDict);
     475  tr_variantFree (&oldDict);
    478476
    479477  /* if caller didn't specify a config dir, use the default */
     
    496494
    497495  /* cleanup */
    498   tr_variantFree (&sessionDefaults);
    499496  tr_free (filename);
    500497  return success;
Note: See TracChangeset for help on using the changeset viewer.