From b9a9f54c452aeb9083398a956bd590c37661f489 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 11 Jun 2010 11:05:37 +0200 Subject: string: Added a function to delete a char basesd stirng object. --- include/libssh/libssh.h | 1 + libssh/string.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index d2ad0e4..4100f03 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -449,6 +449,7 @@ LIBSSH_API ssh_string ssh_string_from_char(const char *what); LIBSSH_API size_t ssh_string_len(ssh_string str); LIBSSH_API ssh_string ssh_string_new(size_t size); LIBSSH_API char *ssh_string_to_char(ssh_string str); +LIBSSH_API void ssh_string_free_char(char *s); #ifndef LIBSSH_LEGACY_0_4 #include "libssh/legacy.h" diff --git a/libssh/string.c b/libssh/string.c index 0a036ad..394179f 100644 --- a/libssh/string.c +++ b/libssh/string.c @@ -142,6 +142,15 @@ char *ssh_string_to_char(struct ssh_string_struct *s) { return new; } +/** + * @brief Deallocate a char string object. + * + * @param[in] s The string to delete. + */ +void ssh_string_free_char(char *s) { + SAFE_FREE(s); +} + /** * @brief Copy a string, return a newly allocated string. The caller has to * free the string. -- cgit