Skip to content

Commit b60f53f

Browse files
committed
bugfix: fixed a memory leak in ssl.cert_pem_to_der(), caught by valgrind.
1 parent 6683a8b commit b60f53f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ngx_http_lua_ssl_certby.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ ngx_http_lua_ffi_cert_pem_to_der(const u_char *pem, size_t pem_len, u_char *der,
853853
x509 = PEM_read_bio_X509_AUX(bio, NULL, NULL, NULL);
854854
if (x509 == NULL) {
855855
*err = "PEM_read_bio_X509_AUX() failed";
856+
BIO_free(bio);
856857
ERR_clear_error();
857858
return NGX_ERROR;
858859
}

0 commit comments

Comments
 (0)