From: Thomas Egerer Date: Mon, 10 Feb 2014 16:14:24 +0000 (+0100) Subject: leak_detective: Assign return value of realloc to buf X-Git-Tag: 5.1.2rc1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b351acfed67b87f9f3a014a6c90807e08816cca2;p=thirdparty%2Fstrongswan.git 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 --- diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c index 36ed1735cd..ff80bbc89b 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; }