From d1e68e97496d0541f3ddd0483f62e185e870c9e4 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 24 Jan 2019 14:59:21 +0100 Subject: openpgp-ffi: Improve error handling. - In case of errors, set *tpk_out to None. --- openpgp-ffi/src/tpk.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'openpgp-ffi') diff --git a/openpgp-ffi/src/tpk.rs b/openpgp-ffi/src/tpk.rs index be2bd56d..62f3f855 100644 --- a/openpgp-ffi/src/tpk.rs +++ b/openpgp-ffi/src/tpk.rs @@ -679,6 +679,9 @@ pub extern "system" fn pgp_tpk_builder_generate *revocation_out = box_raw!(revocation); Status::Success }, - Err(e) => ffi_try_status!(Err::<(), failure::Error>(e)), + Err(e) => { + *tpk_out = None; + ffi_try_status!(Err::<(), failure::Error>(e)) + }, } } -- cgit v1.2.3