summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/cryptolink/openssl_common.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/cryptolink/openssl_common.h b/src/lib/cryptolink/openssl_common.h
index 6011f7e6c8..7e47e698f5 100644
--- a/src/lib/cryptolink/openssl_common.h
+++ b/src/lib/cryptolink/openssl_common.h
@@ -37,10 +37,12 @@ public:
SecBuf(const std::vector<T>& x) : vec_(x) {}
~SecBuf() {
-#if defined(__has_feature) && __has_feature(address_sanitizer)
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
// Make the address sanitizer happy assuming this won't reallocate
vec_.resize(vec_.capacity());
#endif
+#endif
std::memset(&vec_[0], 0, vec_.capacity() * sizeof(T));
};
@@ -69,10 +71,12 @@ public:
};
void clear() {
-#if defined(__has_feature) && __has_feature(address_sanitizer)
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
// Make the address sanitizer happy assuming this won't reallocate
vec_.resize(vec_.capacity());
#endif
+#endif
std::memset(&vec_[0], 0, vec_.capacity() * sizeof(T));
vec_.clear();
}