mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 17:51:26 -04:00
pam_ksu: Move the realm free to end of function
This avoids a use after free. Noted by: jhb
This commit is contained in:
parent
45165aab2d
commit
98f18cd988
1 changed files with 2 additions and 2 deletions
|
|
@ -85,8 +85,6 @@ krb5_make_principal(krb5_context context, krb5_principal principal,
|
|||
if ((rc = krb5_get_default_realm(context, &temp_realm)))
|
||||
return (rc);
|
||||
realm=temp_realm;
|
||||
if (temp_realm)
|
||||
free(temp_realm);
|
||||
}
|
||||
va_start(ap, realm);
|
||||
/*
|
||||
|
|
@ -99,6 +97,8 @@ krb5_make_principal(krb5_context context, krb5_principal principal,
|
|||
*/
|
||||
rc = krb5_build_principal_va(context, principal, strlen(realm), realm, ap);
|
||||
va_end(ap);
|
||||
if (temp_realm)
|
||||
free(temp_realm);
|
||||
return (rc);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue