From 218cd01853820bc9bcd6700f0d3b98458eb7c8a9 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 1 Jun 2006 00:56:12 +0000 Subject: [PATCH] krb5int_get_plugin_dir_data() uses + instead of * in realloc In line 570, in reallocating the plugin tree - the memory allocated is (count + 1) + sizeof(*p) instead of (count +1 ) * sizeof(*p) Detected while running the krb5kdc under valgrind with memcheck. ticket: new tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18070 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/support/plugins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c index 0945d3995..de659cb1a 100644 --- a/src/util/support/plugins.c +++ b/src/util/support/plugins.c @@ -567,7 +567,7 @@ krb5int_get_plugin_dir_data (struct plugin_dir_handle *dirhandle, void **newp = NULL; count++; - newp = realloc (p, ((count + 1) + sizeof (*p))); /* +1 for NULL */ + newp = realloc (p, ((count + 1) * sizeof (*p))); /* +1 for NULL */ if (newp == NULL) { err = errno; } else { -- 2.26.2