summaryrefslogtreecommitdiff
path: root/src/libstrongswan/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/utils.c')
-rw-r--r--src/libstrongswan/utils.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libstrongswan/utils.c b/src/libstrongswan/utils.c
index 2ab061a74..6ffb62aaf 100644
--- a/src/libstrongswan/utils.c
+++ b/src/libstrongswan/utils.c
@@ -102,6 +102,14 @@ void memxor(u_int8_t dst[], u_int8_t src[], size_t n)
/**
* Described in header.
*/
+void memwipe_noinline(void *ptr, size_t n)
+{
+ memwipe_inline(ptr, n);
+}
+
+/**
+ * Described in header.
+ */
void *memstr(const void *haystack, const char *needle, size_t n)
{
unsigned const char *pos = haystack;
@@ -287,7 +295,7 @@ bool ref_put(refcount_t *ref)
bool more_refs;
pthread_mutex_lock(&ref_mutex);
- more_refs = --(*ref);
+ more_refs = --(*ref) > 0;
pthread_mutex_unlock(&ref_mutex);
return !more_refs;
}