diff options
author | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2018-09-24 17:06:38 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-09-27 15:21:30 +0200 |
commit | 11d480134ce2124b3220269737abfa12a8191e41 (patch) | |
tree | 1911edfbed39cd906d8684c056f8f8eb83235a0d | |
parent | 3786db4cdf86bacc4f25a283f5d5b9760e047e22 (diff) | |
download | libssh-11d480134ce2124b3220269737abfa12a8191e41.tar.gz libssh-11d480134ce2124b3220269737abfa12a8191e41.tar.xz libssh-11d480134ce2124b3220269737abfa12a8191e41.zip |
include: Add SSH_KEY_FREE
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | include/libssh/libssh.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index a83bd8a2..a5d046f0 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -630,6 +630,8 @@ typedef int (*ssh_auth_callback) (const char *prompt, char *buf, size_t len, int echo, int verify, void *userdata); LIBSSH_API ssh_key ssh_key_new(void); +#define SSH_KEY_FREE(x) \ + do { if ((x) != NULL) { ssh_key_free(x); x = NULL; } } while(0) LIBSSH_API void ssh_key_free (ssh_key key); LIBSSH_API enum ssh_keytypes_e ssh_key_type(const ssh_key key); LIBSSH_API const char *ssh_key_type_to_char(enum ssh_keytypes_e type); |