Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
7dddd9be
Commit
7dddd9be
authored
Aug 14, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory: free empty directories after removing them (memleak)
dirvec_delete() does not free the object, we have to call directory_free() afterwards.
parent
5d6f7803
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
NEWS
NEWS
+1
-0
directory.c
src/directory.c
+8
-3
No files found.
NEWS
View file @
7dddd9be
...
...
@@ -8,6 +8,7 @@ ver 0.15.2 (2009/??/??)
- flac: don't allocate cuesheet twice (memleak)
* update: free empty path string (memleak)
* update: free temporary string in container scan (memleak)
* directory: free empty directories after removing them (memleak)
ver 0.15.1 (2009/07/15)
...
...
src/directory.c
View file @
7dddd9be
...
...
@@ -73,9 +73,14 @@ directory_prune_empty(struct directory *directory)
struct
dirvec
*
dv
=
&
directory
->
children
;
for
(
i
=
dv
->
nr
;
--
i
>=
0
;
)
{
directory_prune_empty
(
dv
->
base
[
i
]);
if
(
directory_is_empty
(
dv
->
base
[
i
]))
dirvec_delete
(
dv
,
dv
->
base
[
i
]);
struct
directory
*
child
=
dv
->
base
[
i
];
directory_prune_empty
(
child
);
if
(
directory_is_empty
(
child
))
{
dirvec_delete
(
dv
,
child
);
directory_free
(
child
);
}
}
if
(
!
dv
->
nr
)
dirvec_destroy
(
dv
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment