[libfko] always call free() from zero_free() on all non-NULL buf pointers
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user