Skip to content

Commit

Permalink
Merge pull request #205 from JuliaWeb/jq/gcpreserve
Browse files Browse the repository at this point in the history
Add a few missing GC preserves
  • Loading branch information
quinnj authored Jun 18, 2019
2 parents 2494d28 + 09b93b7 commit dcd3453
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function strerror(ret, bufsize=1000)
ccall((:mbedtls_strerror, libmbedcrypto), Cint,
(Cint, Ptr{Cvoid}, Csize_t),
ret, buf, bufsize)
s = unsafe_string(pointer(buf))
s = GC.@preserve buf unsafe_string(pointer(buf))
if ret == MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE
s *= " (You may need to enable `ssl_conf_renegotiation!`. See " *
"https://github.com/JuliaWeb/HTTP.jl/issues/342#issuecomment-432921180)"
Expand Down
2 changes: 1 addition & 1 deletion src/x509_crt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function crt_info(crt::CRT)
ccall((:mbedtls_x509_crt_info, libmbedx509), Cint,
(Ptr{Cvoid}, Csize_t, Cstring, Ptr{Cvoid}),
buf, 1000, "", crt.data)
unsafe_string(pointer(buf))
GC.@preserve buf unsafe_string(pointer(buf))
end

function crt_parse!(chain, buf::String)
Expand Down

0 comments on commit dcd3453

Please sign in to comment.