sshbuf_free(NULL) should be a no-op

This commit is contained in:
Damien Miller
2012-03-26 17:04:40 +11:00
parent 44e5c0f6b2
commit 67ce107972

View File

@@ -87,6 +87,8 @@ sshbuf_free(struct sshbuf *buf)
{
int freeme;
if (buf == NULL)
return;
if (sshbuf_check_sanity(buf) == 0)
bzero(buf->d, buf->alloc);
free(buf->d);