diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-05-17 15:16:24 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-05-19 20:26:56 +0200 |
commit | 7c03edf2fe66855a8ce8f2575c3aaf66af975377 (patch) | |
tree | 7e793f937b759c8808668c8924b71a962f9b21f8 /sql-common | |
parent | 335c4ab790254462753ba4ed8b074c5847b2708f (diff) | |
download | mariadb-git-7c03edf2fe66855a8ce8f2575c3aaf66af975377.tar.gz |
MDEV-6262 analyze the coverity report on mariadb
uploaded 10.0, analyzed everything with the Impact=High
(and a couple of Medium)
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client_plugin.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index dd87b01d932..f93e50125c5 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -375,8 +375,7 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type, if (!(sym= dlsym(dlhandle, plugin_declarations_sym))) { errmsg= "not a plugin"; - (void)dlclose(dlhandle); - goto err; + goto errc; } plugin= (struct st_mysql_client_plugin*)sym; @@ -384,19 +383,19 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type, if (type >=0 && type != plugin->type) { errmsg= "type mismatch"; - goto err; + goto errc; } if (strcmp(name, plugin->name)) { errmsg= "name mismatch"; - goto err; + goto errc; } if (type < 0 && find_plugin(name, plugin->type)) { errmsg= "it is already loaded"; - goto err; + goto errc; } plugin= add_plugin(mysql, plugin, dlhandle, argc, args); @@ -406,6 +405,8 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type, DBUG_PRINT ("leave", ("plugin loaded ok")); DBUG_RETURN (plugin); +errc: + dlclose(dlhandle); err: mysql_mutex_unlock(&LOCK_load_client_plugin); DBUG_PRINT ("leave", ("plugin load error : %s", errmsg)); |