Changeset: b2db84d7abc6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b2db84d7abc6
Modified Files:
sql/backends/monet5/sql.c
Branch: remote_auth
Log Message:
Properly release the lock if something fails
(Thanks Perdo)
diffs (34 lines):
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -3605,16 +3605,16 @@ sql_rt_credentials_wrap(Client cntxt, Ma
goto bailout;
}
- MT_lock_set(&mal_contextLock);
if ((msg = AUTHgetRemoteTableCredentials(*table, &uris, &unames,
&hashs)) != MAL_SUCCEED)
goto bailout;
+ MT_lock_set(&mal_contextLock);
if (BUNappend(urib, uris, FALSE) != GDK_SUCCEED)
- goto bailout;
+ goto lbailout;
if (BUNappend(unameb, unames, FALSE) != GDK_SUCCEED)
- goto bailout;
+ goto lbailout;
if (BUNappend(hashb, hashs, FALSE) != GDK_SUCCEED)
- goto bailout;
+ goto lbailout;
MT_lock_unset(&mal_contextLock);
BBPkeepref(*uri = urib->batCacheid);
BBPkeepref(*uname = unameb->batCacheid);
@@ -3622,6 +3622,9 @@ sql_rt_credentials_wrap(Client cntxt, Ma
return MAL_SUCCEED;
+ lbailout:
+ MT_lock_unset(&mal_contextLock);
+ msg = createException(SQL, "sql.remote_table_credentials",
SQLSTATE(HY001) MAL_MALLOC_FAIL);
bailout:
if (urib) BBPunfix(urib->batCacheid);
if (unameb) BBPunfix(unameb->batCacheid);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list