From: Ruben Kerkhof Date: Sun, 7 Dec 2014 14:01:05 +0000 (+0100) Subject: Check return code of mysql_init() X-Git-Tag: rec-3.7.0-rc1~140^2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1911%2Fhead;p=thirdparty%2Fpdns.git Check return code of mysql_init() Fixes #1908 --- diff --git a/modules/gmysqlbackend/smysql.cc b/modules/gmysqlbackend/smysql.cc index e20aa9fb25..58ad89d639 100644 --- a/modules/gmysqlbackend/smysql.cc +++ b/modules/gmysqlbackend/smysql.cc @@ -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