diff options
author | Ivo Manca | 2016-05-31 13:42:33 +0200 |
---|---|---|
committer | David Sommerseth | 2016-05-31 17:25:11 +0200 |
commit | 8b3b74a04d89350f4cca54a80d15a759c5df5097 (patch) | |
tree | 6bdae97a54377a5e73f523b4430dd70b5a1fcbaa | |
parent | 987910e8abb40e357ac1aa6bf658b4660cc7f376 (diff) | |
download | openvpn-8b3b74a04d89350f4cca54a80d15a759c5df5097.zip openvpn-8b3b74a04d89350f4cca54a80d15a759c5df5097.tar.gz |
Plug memory leak in mbedTLS backend
Signed-off-by: Ivo Manca <pinkel@gmail.com>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1464694953-3681-1-git-send-email-pinkel@gmail.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11752
Signed-off-by: David Sommerseth <dazo@privateinternetaccess.com>
-rw-r--r-- | src/openvpn/ssl_verify_polarssl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/openvpn/ssl_verify_polarssl.c b/src/openvpn/ssl_verify_polarssl.c index 7ed87d6..cc46b75 100644 --- a/src/openvpn/ssl_verify_polarssl.c +++ b/src/openvpn/ssl_verify_polarssl.c @@ -137,7 +137,7 @@ backend_x509_get_serial (openvpn_x509_cert_t *cert, struct gc_arena *gc) if (!polar_ok(mpi_read_binary(&serial_mpi, cert->serial.p, cert->serial.len))) { msg(M_WARN, "Failed to retrieve serial from certificate."); - return NULL; + goto end; } /* Determine decimal representation length, allocate buffer */ @@ -148,9 +148,12 @@ backend_x509_get_serial (openvpn_x509_cert_t *cert, struct gc_arena *gc) if (!polar_ok(mpi_write_string(&serial_mpi, 10, buf, &buflen))) { msg(M_WARN, "Failed to write serial to string."); - return NULL; + buf = NULL; + goto end; } +end: + mpi_free(&serial_mpi); return buf; } |