From: Aki Tuomi Date: Wed, 5 Sep 2018 05:34:28 +0000 (+0300) Subject: driver-sqlpool: Only strdup error on error X-Git-Tag: 2.3.9~1438 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68a2e9904a6d9d9325e930273c4624201e97bb36;p=thirdparty%2Fdovecot%2Fcore.git driver-sqlpool: Only strdup error on error Satisfies static analyzers --- diff --git a/src/lib-sql/driver-sqlpool.c b/src/lib-sql/driver-sqlpool.c index 726d7507fc..556d7f62b7 100644 --- a/src/lib-sql/driver-sqlpool.c +++ b/src/lib-sql/driver-sqlpool.c @@ -515,8 +515,9 @@ int driver_sqlpool_init_full(const struct sql_settings *set, const struct sql_db T_BEGIN { const char *tmp = NULL; - ret = driver_sqlpool_parse_hosts(db, set->connect_string, &tmp); - error = i_strdup(tmp); + if ((ret = driver_sqlpool_parse_hosts(db, set->connect_string, + &tmp)) < 0) + error = i_strdup(tmp); } T_END; if (ret < 0) {