#49638 Issue 49511 - memory leak in pwdhash
Closed 3 years ago by spichugi. Opened 6 years ago by spichugi.
spichugi/389-ds-base pwdhash_memleak  into  master

@@ -243,6 +243,7 @@ 

              if ((enc = (*pwsp->pws_enc)(decoded)) == NULL) {

                  perror(name);

                  rc = 1;

+                 slapi_ch_free_string(&decoded);

                  goto out;

              }

  
@@ -256,12 +257,12 @@ 

                  printf("%s: password does not match.\n", name);

              }

          }

+         slapi_ch_free_string(&decoded);

      }

  

  out:

  

      free_pw_scheme(pwsp);

-     slapi_ch_free_string(&decoded);

  

      plugin_closeall(1 /* Close Backends */, 1 /* Close Globals */);

  

Bug description: When we have multiple inputs
we leak 1 to N strings allocate.

Fix description: We free only one string in the end of main()
but if we have a multiple string inputs we should free
all of them during the for loop.

https://pagure.io/389-ds-base/issue/49511

Reviewed by: ?

rebased onto 58a999aed07d04107c0f9fe59269a3f375d16318

6 years ago

rebased onto 71cbd1d

6 years ago

Pull-Request has been merged by spichugi

6 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/2697

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
Metadata