Add libssh2_free.

This commit is contained in:
Simon Josefsson 2010-10-13 15:19:12 +02:00
parent cd6d41b806
commit 98e38c4f3a
3 changed files with 18 additions and 0 deletions

4
NEWS
View File

@ -1,3 +1,7 @@
This release includes the following changes:
o Added libssh2_free()
libssh2 1.2.7 (August 17, 2010)
This release includes the following changes:

View File

@ -420,6 +420,13 @@ LIBSSH2_API int libssh2_init(int flags);
*/
LIBSSH2_API void libssh2_exit(void);
/*
* libssh2_free()
*
* Deallocate memory allocated by earlier call to libssh2 functions.
*/
LIBSSH2_API void libssh2_free(LIBSSH2_SESSION *session, void *ptr)
/* Session API */
LIBSSH2_API LIBSSH2_SESSION *
libssh2_session_init_ex(LIBSSH2_ALLOC_FUNC((*my_alloc)),

View File

@ -1,5 +1,6 @@
/* Copyright (c) 2004-2007 Sara Golemon <sarag@libssh2.org>
* Copyright (c) 2009 by Daniel Stenberg
* Copyright (c) 2010 Simon Josefsson
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@ -352,6 +353,12 @@ size_t _libssh2_base64_encode(LIBSSH2_SESSION *session,
}
/* ---- End of Base64 Encoding ---- */
LIBSSH2_API void
libssh2_free(LIBSSH2_SESSION *session, void *ptr)
{
LIBSSH2_FREE(session, ptr);
}
#ifdef LIBSSH2DEBUG
LIBSSH2_API int
libssh2_trace(LIBSSH2_SESSION * session, int bitmask)