diff options
author | Jack Lloyd <[email protected]> | 2017-07-25 13:45:18 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-07-25 13:45:18 -0400 |
commit | 9864578977e40715854de1b60501f217147b7452 (patch) | |
tree | 5797131a8a5a6aff7f6e24754e65add3357909d9 | |
parent | 2856ac83c9654fdd410bbb8b87bcaaaa0d20b868 (diff) |
Add missing return in ffi_delete_object
Somehow this still passed all the tests, downside of 0 as the success
return I suppose.
-rw-r--r-- | src/lib/ffi/ffi.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp index 7e5f19d1d..0a591ca44 100644 --- a/src/lib/ffi/ffi.cpp +++ b/src/lib/ffi/ffi.cpp @@ -199,6 +199,10 @@ int apply_fn(botan_struct<T, M>* o, const char* func_name, F func) return BOTAN_FFI_ERROR_UNKNOWN_ERROR; } +#define BOTAN_FFI_DO(T, obj, param, block) \ + apply_fn(obj, BOTAN_CURRENT_FUNCTION, \ + [=](T& param) -> int { do { block } while(0); return BOTAN_FFI_SUCCESS; }) + template<typename T, uint32_t M> int ffi_delete_object(botan_struct<T, M>* obj, const char* func_name) { @@ -211,6 +215,7 @@ int ffi_delete_object(botan_struct<T, M>* obj, const char* func_name) return BOTAN_FFI_ERROR_INVALID_INPUT; delete obj; + return BOTAN_FFI_SUCCESS; } catch(std::exception& e) { @@ -222,10 +227,6 @@ int ffi_delete_object(botan_struct<T, M>* obj, const char* func_name) } } -#define BOTAN_FFI_DO(T, obj, param, block) \ - apply_fn(obj, BOTAN_CURRENT_FUNCTION, \ - [=](T& param) -> int { do { block } while(0); return BOTAN_FFI_SUCCESS; }) - #define BOTAN_FFI_CHECKED_DELETE(o) ffi_delete_object(o, BOTAN_CURRENT_FUNCTION) inline int write_output(uint8_t out[], size_t* out_len, const uint8_t buf[], size_t buf_len) |