From 865963d8362e3a1a3e46e5482cf623622504afb5 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 7 Dec 2014 15:01:05 +0100 Subject: [PATCH] Check return code of mysql_init() Fixes #1908 --- modules/gmysqlbackend/smysql.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.47.2