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:
@@ -53,6 +53,10 @@ struct buffer_struct *buffer_new(void) {
|
|||||||
* \param buffer buffer to free
|
* \param buffer buffer to free
|
||||||
*/
|
*/
|
||||||
void buffer_free(struct buffer_struct *buffer) {
|
void buffer_free(struct buffer_struct *buffer) {
|
||||||
|
if (buffer == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (buffer->data) {
|
if (buffer->data) {
|
||||||
/* burn the data */
|
/* burn the data */
|
||||||
memset(buffer->data, 0, buffer->allocated);
|
memset(buffer->data, 0, buffer->allocated);
|
||||||
|
|||||||
Reference in New Issue
Block a user