Commit 57af0b92 by Carlos Martín Nieto

cred: add a free function wrapper

parent 47ed7e5a
......@@ -307,6 +307,17 @@ GIT_EXTERN(int) git_cred_ssh_key_memory_new(
const char *privatekey,
const char *passphrase);
/**
* Free a credential.
*
* This is only necessary if you own the object; that is, if you are a
* transport.
*
* @param cred the object to free
*/
GIT_EXTERN(void) git_cred_free(git_cred *cred);
/**
* Signature of a function which acquires a credential object.
*
......
......@@ -378,3 +378,11 @@ int git_cred_username_new(git_cred **cred, const char *username)
*cred = (git_cred *) c;
return 0;
}
void git_cred_free(git_cred *cred)
{
if (!cred)
return;
cred->free(cred);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment