Browse Source

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
Stanislav Levin 7 years ago
parent
commit
b646e4dafe

+ 1 - 1
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_ */

+ 2 - 2
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 */