Skip to content

Commit

Permalink
kadm5: kadm5_add_passwd_quality_verifier memory leak
Browse files Browse the repository at this point in the history
if krb5_get_config_strings() returns the empty string do not return
immediately.  Instead the for() loop will be skipped because the empty
string represents the end of the string list permitting
krb5_config_free_strings() to free the allocated memory.

Change-Id: Ia6fdb13f716c07b53c8b3857af4f7ab8be578882
  • Loading branch information
jaltman committed Nov 19, 2016
1 parent a33b6d6 commit 989a7c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kadm5/password_quality.c
Expand Up @@ -378,15 +378,15 @@ kadm5_add_passwd_quality_verifier(krb5_context context,
#ifdef HAVE_DLOPEN

if(check_library == NULL) {
krb5_error_code ret;
krb5_error_code ret = 0;
char **strs;
char **tmp;

strs = krb5_config_get_strings(context, NULL,
"password_quality",
"policy_libraries",
NULL);
if(strs == NULL || *strs == NULL)
if (strs == NULL)
return 0;

for (tmp = strs; *tmp; tmp++) {
Expand Down

0 comments on commit 989a7c3

Please sign in to comment.