Fix two instances in pam_krb5(8), where the variable 'princ_name' could

be used uninitialized.

Found by:	clang 3.2
Reviewed by:	des
MFC after:	1 week
This commit is contained in:
Dimitry Andric 2012-08-06 18:40:14 +00:00
parent c9516c94b4
commit 2251b30757

View File

@ -338,11 +338,11 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
PAM_LOG("Done cleanup");
cleanup2:
krb5_free_principal(pam_context, princ);
PAM_LOG("Done cleanup2");
cleanup3:
if (princ_name)
free(princ_name);
PAM_LOG("Done cleanup2");
cleanup3:
krb5_free_context(pam_context);
PAM_LOG("Done cleanup3");
@ -805,11 +805,11 @@ pam_sm_chauthtok(pam_handle_t *pamh, int flags,
PAM_LOG("Done cleanup");
cleanup2:
krb5_free_principal(pam_context, princ);
PAM_LOG("Done cleanup2");
cleanup3:
if (princ_name)
free(princ_name);
PAM_LOG("Done cleanup2");
cleanup3:
krb5_free_context(pam_context);
PAM_LOG("Done cleanup3");