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
bcfc62a3
Commit
bcfc62a3
authored
Oct 18, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlaylistEdit, QueueSave: free the Song object after Append()
Fix for a major memory leak.
parent
d1924867
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
PlaylistEdit.cxx
src/PlaylistEdit.cxx
+5
-1
QueueSave.cxx
src/QueueSave.cxx
+2
-0
No files found.
src/PlaylistEdit.cxx
View file @
bcfc62a3
...
...
@@ -64,7 +64,9 @@ playlist::AppendFile(struct player_control &pc,
if
(
song
==
nullptr
)
return
PLAYLIST_RESULT_NO_SUCH_SONG
;
return
AppendSong
(
pc
,
song
,
added_id
);
const
auto
result
=
AppendSong
(
pc
,
song
,
added_id
);
song
->
Free
();
return
result
;
}
enum
playlist_result
...
...
@@ -125,6 +127,8 @@ playlist::AppendURI(struct player_control &pc,
enum
playlist_result
result
=
AppendSong
(
pc
,
song
,
added_id
);
if
(
db
!=
nullptr
)
db
->
ReturnSong
(
song
);
else
song
->
Free
();
return
result
;
}
...
...
src/QueueSave.cxx
View file @
bcfc62a3
...
...
@@ -128,4 +128,6 @@ queue_load_song(TextFile &file, const char *line, queue *queue)
if
(
db
!=
nullptr
)
db
->
ReturnSong
(
song
);
else
song
->
Free
();
}
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