diff options
| author | Ezra Peisach <epeisach@mit.edu> | 2000-09-26 17:01:58 +0000 |
|---|---|---|
| committer | Ezra Peisach <epeisach@mit.edu> | 2000-09-26 17:01:58 +0000 |
| commit | d1810074391d0e3dfae9df15e715c25425e606cd (patch) | |
| tree | e83139a54278453c0c5c6ca04fa857479271fbdb /src | |
| parent | f51760a152c68a43c4fc2762468eb390e30f7255 (diff) | |
* conv_princ.c (krb5_425_conv_principal): Call profile_free_list
on v4realms during the iteration loop. Do not call
profile_release_string with a NULL pointer.
Fixes a memory leak.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12678 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/krb5/krb/ChangeLog | 6 | ||||
| -rw-r--r-- | src/lib/krb5/krb/conv_princ.c | 14 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 014042b1cd..b6a5bc4aef 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +Tue Sep 26 13:00:54 2000 Ezra Peisach <epeisach@mit.edu> + + * conv_princ.c (krb5_425_conv_principal): Call profile_free_list + on v4realms during the iteration loop. Do not call + profile_release_string with a NULL pointer. + 2000-09-25 Ezra Peisach <epeisach@mit.edu> * t_kerb.c: Add prototypes for test functions. diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c index f0d3d3d31e..c880de3eb4 100644 --- a/src/lib/krb5/krb/conv_princ.c +++ b/src/lib/krb5/krb/conv_princ.c @@ -272,6 +272,10 @@ krb5_425_conv_principal(context, name, instance, realm, princ) } else if ((retval == 0) && (realm_name == NULL)) { break; } + if (v4realms != NULL) { + profile_free_list(v4realms); + v4realms = NULL; + } if (realm_name != NULL) { profile_release_string (realm_name); realm_name = NULL; @@ -327,10 +331,10 @@ krb5_425_conv_principal(context, name, instance, realm, princ) not_service: retval = krb5_build_principal(context, princ, strlen(realm), realm, name, instance, 0); - profile_iterator_free (&iterator); - profile_free_list(full_name); - profile_free_list(v4realms); - profile_release_string (realm_name); - profile_release_string (dummy_value); + if (iterator) profile_iterator_free (&iterator); + if (full_name) profile_free_list(full_name); + if (v4realms) profile_free_list(v4realms); + if (realm_name) profile_release_string (realm_name); + if (dummy_value) profile_release_string (dummy_value); return retval; } |
