Changeset 13881


Ignore:
Timestamp:
Jan 27, 2013, 6:19:33 AM (8 years ago)
Author:
jordan
Message:

(libT) #5259 'Minor memory leak in tr_torrentDeleteLocalData()' -- fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r13880 r13881  
    28312831            for (;;) {
    28322832                char * parent = tr_dirname (dir);
    2833                 if (tr_is_same_file (top, parent) || !strcmp (top, parent)) {
    2834                     if (tr_ptrArrayFindSorted (&folders, dir, vstrcmp) == NULL) {
    2835                         tr_ptrArrayInsertSorted (&folders, tr_strdup (dir), vstrcmp);
    2836                     }
    2837                     break;
    2838                 }
    2839                 tr_free (dir);
     2833                const bool done_walking = tr_is_same_file (top, parent) || !strcmp (top, parent);
     2834                if (done_walking && tr_ptrArrayFindSorted (&folders, dir, vstrcmp))
     2835                  tr_ptrArrayInsertSorted (&folders, dir, vstrcmp); /* folders assumes ownership of dir */
     2836                else
     2837                  tr_free (dir);
    28402838                dir = parent;
     2839                if (done_walking)
     2840                  break;
    28412841            }
    28422842        }
Note: See TracChangeset for help on using the changeset viewer.