if(!dotth && !strncmp(p, "TTH:", 4))
{
dotth = 1;
- if((buf = base32decode(p + 4, &buflen)) == NULL)
- goto out;
- if(buflen != 24)
+ if(((buf = base32decode(p + 4, &buflen)) == NULL) || (buflen != 24))
+ {
+ free(buf);
goto out;
+ }
memcpy(hashtth, buf, 24);
free(buf);
} else {