From b351acfed67b87f9f3a014a6c90807e08816cca2 Mon Sep 17 00:00:00 2001 From: Thomas Egerer Date: Mon, 10 Feb 2014 17:14:24 +0100 Subject: [PATCH] leak_detective: Assign return value of realloc to buf If realloc return a pointer value different from the value to be reallocated, a double free can occur in this context. Signed-off-by: Thomas Egerer --- src/libstrongswan/utils/leak_detective.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c index 36ed1735c..ff80bbc89 100644 --- a/src/libstrongswan/utils/leak_detective.c +++ b/src/libstrongswan/utils/leak_detective.c @@ -483,7 +483,7 @@ static void* real_realloc(void *ptr, size_t size) static bool register_hooks() { void *buf = real_malloc(8); - real_realloc(buf, 16); + buf = real_realloc(buf, 16); real_free(buf); return TRUE; }