kim_identity_change_password_with_credential leaks krb5_creds
authorAlexandra Ellwood <lxs@mit.edu>
Tue, 21 Oct 2008 21:56:10 +0000 (21:56 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Tue, 21 Oct 2008 21:56:10 +0000 (21:56 +0000)
ticket: new

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20907 dc483132-0cff-0310-8789-dd5450dbe970

src/kim/lib/kim_identity.c

index 7cf53d4f00d06ffa35a4e82b63b3196c06be7bb8..834b8d614c05e4717b1df6c08a7e85fa30eda46f 100644 (file)
@@ -569,6 +569,7 @@ kim_error kim_identity_change_password_with_credential (kim_identity    in_ident
     krb5_data message_data;
     krb5_data description_data;
     
+    if (!err && !in_identity     ) { err = check_error (KIM_NULL_PARAMETER_ERR); }
     if (!err && !in_credential   ) { err = check_error (KIM_NULL_PARAMETER_ERR); }
     if (!err && !in_new_password ) { err = check_error (KIM_NULL_PARAMETER_ERR); }
     if (!err && !in_ui_context   ) { err = check_error (KIM_NULL_PARAMETER_ERR); }
@@ -666,6 +667,8 @@ kim_error kim_identity_change_password_with_credential (kim_identity    in_ident
         *out_rejected_err = rejected_err;
     }
     
+    if (creds) { krb5_free_creds (in_identity->context, creds); }
+    
     return check_error (err);
 }