From 1b193a1e97aaf0ab36ba819111239a7f71ef157c Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Nov 28 2018 19:24:35 +0000 Subject: Pass argument into hashtable_new @8915d8d87 and @4471b7350 modified "usetxn" parameter in "hashtable_new" scope (was a global variable before). But the callers of this function don't pass argument into. Thus, "usetxn" acts as an uninitialized auto variable. Fixes: https://pagure.io/389-ds-base/issue/50057 --- diff --git a/ldap/servers/plugins/memberof/memberof.h b/ldap/servers/plugins/memberof/memberof.h index cf02845..f049d38 100644 --- a/ldap/servers/plugins/memberof/memberof.h +++ b/ldap/servers/plugins/memberof/memberof.h @@ -102,7 +102,7 @@ void *memberof_get_plugin_id(void); void memberof_release_config(void); PRUint64 get_plugin_started(void); void ancestor_hashtable_entry_free(memberof_cached_value *entry); -PLHashTable *hashtable_new(); +PLHashTable *hashtable_new(int usetxn); int memberof_use_txn(); #endif /* _MEMBEROF_H_ */ diff --git a/ldap/servers/plugins/memberof/memberof_config.c b/ldap/servers/plugins/memberof/memberof_config.c index 8a27f52..04d5924 100644 --- a/ldap/servers/plugins/memberof/memberof_config.c +++ b/ldap/servers/plugins/memberof/memberof_config.c @@ -698,8 +698,8 @@ memberof_copy_config(MemberOfConfig *dest, MemberOfConfig *src) /* Allocate our caches here since we only copy the config at the start of an op */ if (memberof_use_txn() == 1){ - dest->ancestors_cache = hashtable_new(); - dest->fixup_cache = hashtable_new(); + dest->ancestors_cache = hashtable_new(1); + dest->fixup_cache = hashtable_new(1); } /* Check if the copy is already up to date */