aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/utils/leak_detective.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c
index 1543c7f99..a0bdae715 100644
--- a/src/libstrongswan/utils/leak_detective.c
+++ b/src/libstrongswan/utils/leak_detective.c
@@ -810,10 +810,11 @@ HOOK(void*, malloc, size_t bytes)
HOOK(void*, calloc, size_t nmemb, size_t size)
{
void *ptr;
+ volatile size_t total;
- size *= nmemb;
- ptr = malloc(size);
- memset(ptr, 0, size);
+ total = nmemb * size;
+ ptr = malloc(total);
+ memset(ptr, 0, total);
return ptr;
}