]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Check return code of mysql_init() 1911/head
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 7 Dec 2014 14:01:05 +0000 (15:01 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 7 Dec 2014 14:01:05 +0000 (15:01 +0100)
Fixes #1908

modules/gmysqlbackend/smysql.cc

index e20aa9fb25972bdc55aff7d3a3e5e6b4820cc8c9..58ad89d639973fe1480f9935764488c540d07e1a 100644 (file)
@@ -19,7 +19,9 @@ SMySQL::SMySQL(const string &database, const string &host, uint16_t port, const
   int retry=1;
 
   Lock l(&s_myinitlock);
-  mysql_init(&d_db);
+  if (!mysql_init(&d_db))
+    throw sPerrorException("Unable to initialize mysql driver");
+
   do {
 
 #if MYSQL_VERSION_ID >= 50013