From: František Dvořák Date: Fri, 6 Jun 2008 14:04:31 +0000 (+0000) Subject: Revert the context "fix" - on error is good to know the error from the context. X-Git-Tag: glite-yaim-lb_R_4_0_3_1~4 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=631e5f0181fbbc5d530edd6f66dc03103d674bf4;p=jra1mw.git Revert the context "fix" - on error is good to know the error from the context. --- diff --git a/org.glite.lbjp-common.db/src/db.c b/org.glite.lbjp-common.db/src/db.c index 9827820..5738141 100644 --- a/org.glite.lbjp-common.db/src/db.c +++ b/org.glite.lbjp-common.db/src/db.c @@ -192,11 +192,8 @@ int glite_lbu_InitDBContext(glite_lbu_DBContext *ctx) { pthread_mutex_lock(&db_handle.lock); if (!db_handle.lib) { if ((!MYSQL_LIBPATH[0] || (db_handle.lib = dlopen(MYSQL_LIBPATH, RTLD_LAZY | RTLD_LOCAL)) == NULL) && - (db_handle.lib = dlopen("libmysqlclient.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { - free(*ctx); - *ctx = NULL; + (db_handle.lib = dlopen("libmysqlclient.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) return ERR(*ctx, ENOENT, "can't load '%s' or 'libmysqlclient.so' (%s)", MYSQL_LIBPATH, dlerror()); - } do { LOAD(mysql_init, "mysql_init"); LOAD(mysql_get_client_version, "mysql_get_client_version"); @@ -244,8 +241,6 @@ int glite_lbu_InitDBContext(glite_lbu_DBContext *ctx) { dlclose(db_handle.lib); db_handle.lib = NULL; pthread_mutex_unlock(&db_handle.lock); - free(*ctx); - *ctx = NULL; return err; } } else pthread_mutex_unlock(&db_handle.lock);