leak-detective: Make sure to actually call malloc() from calloc() hook
authorTobias Brunner <tobias@strongswan.org>
Wed, 15 Jun 2016 09:22:04 +0000 (11:22 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 15 Jun 2016 14:21:47 +0000 (16:21 +0200)
commite0c59faa68127b9016c45b3ff6ca6e93e19d6970
treef817b096e1852b2c4ecaa0f8b5e66e50362920d8
parent8f1806605d938eec758fbefa9657dc0f58ed1c7e
leak-detective: Make sure to actually call malloc() from calloc() hook

Newer versions of GCC are too "smart" and replace a call to malloc(X)
followed by a call to memset(0,X) with a call co calloc(), which obviously
results in an infinite loop when it does that in our own calloc()
implementation.  Using `volatile` for the variable storing the total size
prevents the optimization and we actually call malloc().
src/libstrongswan/utils/leak_detective.c