mirror of
https://git.proxmox.com/git/libgit2
synced 2025-12-30 19:51:27 +00:00
cred: add a free function wrapper
This commit is contained in:
parent
47ed7e5acd
commit
57af0b928e
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user