In this case the memory allocated can also be significant, in which case
freezero() will have less overhead than explicit_bzero() (munmap instead
of touching all of the memory to write zeros).
-/* $OpenBSD: ssl_asn1.c,v 1.49 2017/02/07 02:08:38 beck Exp $ */
+/* $OpenBSD: ssl_asn1.c,v 1.50 2017/04/10 16:47:08 jsing Exp $ */
/*
* Copyright (c) 2016 Joel Sing <jsing@openbsd.org>
rv = (int)data_len;
err:
- if (data != NULL)
- explicit_bzero(data, data_len);
-
CBB_cleanup(&session);
+ freezero(data, data_len);
free(peer_cert_bytes);
- free(data);
return rv;
}