summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-12-07 16:01:03 +0000
committerjsing <jsing@openbsd.org>2014-12-07 16:01:03 +0000
commitcc8f79dd3d2ed687d5336674ad80a68d49b88650 (patch)
tree7becfdbeb0e25fd29588aea8d5d03d5aa0fd54bd
parentMake sure to load absolute symbol address with `dla' instead of `la' when (diff)
downloadwireguard-openbsd-cc8f79dd3d2ed687d5336674ad80a68d49b88650.tar.xz
wireguard-openbsd-cc8f79dd3d2ed687d5336674ad80a68d49b88650.zip
Fix a memory leak in tls_check_subject_altname() by calling
sk_GENERAL_NAME_pop_free() instead of sk_GENERAL_NAME_free(). The latter only frees the stack itself and does not free the items. From Basskrapfen on github.
-rw-r--r--lib/libtls/tls_verify.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libtls/tls_verify.c b/lib/libtls/tls_verify.c
index 35a18202a9f..ddc403fb10d 100644
--- a/lib/libtls/tls_verify.c
+++ b/lib/libtls/tls_verify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls_verify.c,v 1.3 2014/12/07 15:48:02 bcook Exp $ */
+/* $OpenBSD: tls_verify.c,v 1.4 2014/12/07 16:01:03 jsing Exp $ */
/*
* Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org>
*
@@ -155,7 +155,7 @@ tls_check_subject_altname(X509 *cert, const char *host)
}
}
- sk_GENERAL_NAME_free(altname_stack);
+ sk_GENERAL_NAME_pop_free(altname_stack, GENERAL_NAME_free);
return rv;
}