Ignore:
Timestamp:
Jan 31, 2013, 9:57:08 PM (8 years ago)
Author:
jordan
Message:

(libT) fix dangling pointer in tor->currentDir when reloading a .resume file from disk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/resume.c

    r13868 r13912  
    729729      && (str && *str))
    730730    {
     731        const bool is_current_dir = tor->currentDir == tor->downloadDir;
    731732        tr_free (tor->downloadDir);
    732733        tor->downloadDir = tr_strndup (str, len);
     734        if (is_current_dir)
     735          tor->currentDir = tor->downloadDir;
    733736        fieldsLoaded |= TR_FR_DOWNLOAD_DIR;
    734737    }
     
    738741      && (str && *str))
    739742    {
     743        const bool is_current_dir = tor->currentDir == tor->incompleteDir;
    740744        tr_free (tor->incompleteDir);
    741745        tor->incompleteDir = tr_strndup (str, len);
     746        if (is_current_dir)
     747          tor->currentDir = tor->incompleteDir;
    742748        fieldsLoaded |= TR_FR_INCOMPLETE_DIR;
    743749    }
Note: See TracChangeset for help on using the changeset viewer.