mirror of
https://github.com/transmission/transmission
synced 2025-02-23 22:50:41 +00:00
(libT) #5259 'Minor memory leak in tr_torrentDeleteLocalData()' -- fixed.
This commit is contained in:
parent
5f9e7f773b
commit
d9940acf75
1 changed files with 7 additions and 7 deletions
|
@ -2830,14 +2830,14 @@ deleteLocalData (tr_torrent * tor, tr_fileFunc func)
|
|||
if (!tr_is_same_file (top, dir) && strcmp (top, dir)) {
|
||||
for (;;) {
|
||||
char * parent = tr_dirname (dir);
|
||||
if (tr_is_same_file (top, parent) || !strcmp (top, parent)) {
|
||||
if (tr_ptrArrayFindSorted (&folders, dir, vstrcmp) == NULL) {
|
||||
tr_ptrArrayInsertSorted (&folders, tr_strdup (dir), vstrcmp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
tr_free (dir);
|
||||
const bool done_walking = tr_is_same_file (top, parent) || !strcmp (top, parent);
|
||||
if (done_walking && tr_ptrArrayFindSorted (&folders, dir, vstrcmp))
|
||||
tr_ptrArrayInsertSorted (&folders, dir, vstrcmp); /* folders assumes ownership of dir */
|
||||
else
|
||||
tr_free (dir);
|
||||
dir = parent;
|
||||
if (done_walking)
|
||||
break;
|
||||
}
|
||||
}
|
||||
tr_free (dir);
|
||||
|
|
Loading…
Reference in a new issue