#50058 Pass argument into hashtable_new
Closed 3 years ago by spichugi. Opened 5 years ago by slev.

@@ -102,7 +102,7 @@ 

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

@@ -698,8 +698,8 @@ 

  

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

@8915d8d87 and @4471b7350 modified "usetxn" parameter in
"hashtable_new" scope (was a global variable before).
But the callers of this function don't pass an argument into.
Thus, "usetxn" acts like an uninitialized auto variable.

Originally made for 1.3.9, but can be imported to 1.4.x.

Fixes: https://pagure.io/389-ds-base/issue/50057

Pull-Request has been merged by mreynolds

5 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3117

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago