aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/SimpleDatabasePlugin.cxx
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-01-27 13:26:17 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-01-28 00:13:46 +0600
commite98e2a0b07363132707146f571d3411e3e1b8076 (patch)
treece4653efde5670ca2a151e2888114ac9c0423fe4 /src/db/SimpleDatabasePlugin.cxx
parent943064bb5148884339ccaf60e276191bc4d9abd9 (diff)
downloadmpd-e98e2a0b07363132707146f571d3411e3e1b8076.tar.gz
mpd-e98e2a0b07363132707146f571d3411e3e1b8076.tar.xz
mpd-e98e2a0b07363132707146f571d3411e3e1b8076.zip
Path::FromUTF8() returns nulled instance on error, add error handling where required
Diffstat (limited to 'src/db/SimpleDatabasePlugin.cxx')
-rw-r--r--src/db/SimpleDatabasePlugin.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx
index b7c60d9d8..d617b08dd 100644
--- a/src/db/SimpleDatabasePlugin.cxx
+++ b/src/db/SimpleDatabasePlugin.cxx
@@ -71,6 +71,12 @@ SimpleDatabase::Configure(const struct config_param *param, GError **error_r)
path = Path::FromUTF8(_path);
free(_path);
+ if (path.IsNull()) {
+ g_set_error(error_r, simple_db_quark(), 0,
+ "Failed to convert database path to FS encoding");
+ return false;
+ }
+
return true;
}