Changeset: 84252c010b7d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/84252c010b7d
Modified Files:
monetdb5/mal/mal_authorize.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_user.c
Branch: resource_management
Log Message:
AUTHdecypherValue uses tls allocator
diffs (53 lines):
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -126,7 +126,9 @@ AUTHdecypherValueLocked(str *ret, const
if (vaultKey == NULL)
throw(MAL, "decypherValue", "The vault is still locked!");
- w = r = GDKmalloc(sizeof(char) * (strlen(value) + 1));
+ allocator *ma = MT_thread_getallocator();
+ assert(ma);
+ w = r = ma_alloc(ma, sizeof(char) * (strlen(value) + 1));
if (r == NULL)
throw(MAL, "decypherValue", SQLSTATE(HY013) MAL_MALLOC_FAIL);
diff --git a/sql/backends/monet5/sql_scenario.c
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -421,7 +421,7 @@ userCheckCredentials( mvc *m, Client c,
/* generate the hash as the client should have done */
str hash = mcrypt_hashPassword(algo, pwd, challenge);
- GDKfree(pwd);
+ //GDKfree(pwd);
if(!hash)
throw(MAL, "checkCredentials", "hash '%s' backend not found",
algo);
diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c
--- a/sql/backends/monet5/sql_user.c
+++ b/sql/backends/monet5/sql_user.c
@@ -131,10 +131,10 @@ changeUserPassword(mvc *m, oid rid, str
GDKfree(passValue);
if (strcmp(oldpass, hash) != 0) {
(void) sql_error(m, 02, SQLSTATE(42000)
"changeUserPassword: password mismatch");
- GDKfree(hash);
+ //GDKfree(hash);
return LOG_ERR;
}
- GDKfree(hash);
+ //GDKfree(hash);
}
return setUserPassword(m, rid, newpass);
}
@@ -948,8 +948,8 @@ remote_create(mvc *m, sqlid id, const ch
if (pwhash != NULL) {
if (!pw_encrypted)
free(pwhash);
- else
- GDKfree(pwhash);
+ //else
+ // GDKfree(pwhash);
}
if (msg != MAL_SUCCEED)
return msg;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]