upstream: Plug mem leak on error path. Coverity CID 405026, ok djm@.

OpenBSD-Commit-ID: 8212ca05d01966fb5e72205c592b2257708a2aac
This commit is contained in:
dtucker@openbsd.org 2023-03-10 04:06:21 +00:00 committed by Darren Tucker
parent bf4dae0ad1
commit 89b8df518f
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

3
dns.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: dns.c,v 1.43 2023/02/10 04:56:30 djm Exp $ */ /* $OpenBSD: dns.c,v 1.44 2023/03/10 04:06:21 dtucker Exp $ */
/* /*
* Copyright (c) 2003 Wesley Griffin. All rights reserved. * Copyright (c) 2003 Wesley Griffin. All rights reserved.
@ -258,6 +258,7 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address,
if (!dns_read_key(&hostkey_algorithm, &dnskey_digest_type, if (!dns_read_key(&hostkey_algorithm, &dnskey_digest_type,
&hostkey_digest, &hostkey_digest_len, hostkey)) { &hostkey_digest, &hostkey_digest_len, hostkey)) {
error("Error calculating key fingerprint."); error("Error calculating key fingerprint.");
free(dnskey_digest);
freerrset(fingerprints); freerrset(fingerprints);
return -1; return -1;
} }