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
738d6f10
Commit
738d6f10
authored
Jan 19, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/proxy: simplify error handling in GetSong()
Check mpd_response_finish() before using mpd_song. Don't skip this check even if the mpd_song is non-nullptr.
parent
ba372197
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
ProxyDatabasePlugin.cxx
src/db/ProxyDatabasePlugin.cxx
+9
-11
No files found.
src/db/ProxyDatabasePlugin.cxx
View file @
738d6f10
...
@@ -440,22 +440,20 @@ ProxyDatabase::GetSong(const char *uri, Error &error) const
...
@@ -440,22 +440,20 @@ ProxyDatabase::GetSong(const char *uri, Error &error) const
}
}
struct
mpd_song
*
song
=
mpd_recv_song
(
connection
);
struct
mpd_song
*
song
=
mpd_recv_song
(
connection
);
Song
*
song2
=
song
!=
nullptr
if
(
!
mpd_response_finish
(
connection
)
&&
?
Convert
(
song
)
!
CheckError
(
connection
,
error
))
{
:
nullptr
;
if
(
song
!=
nullptr
)
if
(
song
!=
nullptr
)
mpd_song_free
(
song
);
mpd_song_free
(
song
);
if
(
!
mpd_response_finish
(
connection
))
{
if
(
song2
!=
nullptr
)
song2
->
Free
();
CheckError
(
connection
,
error
);
return
nullptr
;
return
nullptr
;
}
}
if
(
song
2
==
nullptr
)
if
(
song
==
nullptr
)
{
error
.
Format
(
db_domain
,
DB_NOT_FOUND
,
"No such song: %s"
,
uri
);
error
.
Format
(
db_domain
,
DB_NOT_FOUND
,
"No such song: %s"
,
uri
);
return
nullptr
;
}
Song
*
song2
=
Convert
(
song
);
mpd_song_free
(
song
);
return
song2
;
return
song2
;
}
}
...
...
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