Plug mem leak on error path. Coverity CID 405026, ok djm@.
authordtucker <dtucker@openbsd.org>
Fri, 10 Mar 2023 04:06:21 +0000 (04:06 +0000)
committerdtucker <dtucker@openbsd.org>
Fri, 10 Mar 2023 04:06:21 +0000 (04:06 +0000)
usr.bin/ssh/dns.c

index 89872e0..3b53855 100644 (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.
@@ -256,6 +256,7 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address,
                if (!dns_read_key(&hostkey_algorithm, &dnskey_digest_type,
                    &hostkey_digest, &hostkey_digest_len, hostkey)) {
                        error("Error calculating key fingerprint.");
+                       free(dnskey_digest);
                        freerrset(fingerprints);
                        return -1;
                }