mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Fix possible free-memory ref in e75069f79a
This commit is contained in:
@@ -36,8 +36,11 @@ static unsigned char *digest;
|
|||||||
|
|
||||||
void hash_questions_init(void)
|
void hash_questions_init(void)
|
||||||
{
|
{
|
||||||
if (!(hash = hash_find("sha256")) || !hash_init(hash, &ctx, &digest))
|
if (!(hash = hash_find("sha256")))
|
||||||
die(_("Failed to create SHA-256 hash object"), NULL, EC_MISC);
|
die(_("Failed to create SHA-256 hash object"), NULL, EC_MISC);
|
||||||
|
|
||||||
|
ctx = safe_malloc(hash->context_size);
|
||||||
|
digest = safe_malloc(hash->digest_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char *hash_questions(struct dns_header *header, size_t plen, char *name)
|
unsigned char *hash_questions(struct dns_header *header, size_t plen, char *name)
|
||||||
|
|||||||
Reference in New Issue
Block a user