[libfko] always call free() from zero_free() on all non-NULL buf pointers

This commit is contained in:
Michael Rash
2013-07-10 23:09:41 -04:00
parent a42bfd38c2
commit 6c24b1c858

View File

@@ -404,9 +404,15 @@ int zero_free(char *buf, int len)
{
int res = FKO_SUCCESS;
if(buf == NULL || len == 0)
if(buf == NULL)
return res;
if(len == 0)
{
free(buf); /* always free() if buf != NULL */
return res;
}
res = zero_buf(buf, len);
free(buf);