aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-09-28 15:36:57 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-10-19 22:01:28 +0200
commit3b6a76fb9fe72ea28417623c71d911b9c32d82d6 (patch)
treee9c205845424f88f9acd20fe7d38581c7e093c89
parent1cdc13d635c770cbf5b3de93aca95848e2da8964 (diff)
downloadlibssh-3b6a76fb9fe72ea28417623c71d911b9c32d82d6.tar.gz
libssh-3b6a76fb9fe72ea28417623c71d911b9c32d82d6.tar.xz
libssh-3b6a76fb9fe72ea28417623c71d911b9c32d82d6.zip
messages: Add SSH_MESSAGE_FREE
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--include/libssh/libssh.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index f0ec9bf1..e30d4814 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -596,6 +596,8 @@ SSH_DEPRECATED LIBSSH_API void ssh_log(ssh_session session,
LIBSSH_API ssh_channel ssh_message_channel_request_open_reply_accept(ssh_message msg);
LIBSSH_API int ssh_message_channel_request_reply_success(ssh_message msg);
+#define SSH_MESSAGE_FREE(x) \
+ do { if ((x) != NULL) { ssh_message_free(x); (x) = NULL; } } while(0)
LIBSSH_API void ssh_message_free(ssh_message msg);
LIBSSH_API ssh_message ssh_message_get(ssh_session session);
LIBSSH_API int ssh_message_subtype(ssh_message msg);