1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

Add NULL check to buffer free.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@332 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-04-01 21:29:04 +00:00
parent 7b464d4e15
commit fc73b0b33f

View File

@@ -53,6 +53,10 @@ struct buffer_struct *buffer_new(void) {
* \param buffer buffer to free
*/
void buffer_free(struct buffer_struct *buffer) {
if (buffer == NULL) {
return;
}
if (buffer->data) {
/* burn the data */
memset(buffer->data, 0, buffer->allocated);