From: Ezra Peisach Date: Thu, 1 Jun 2006 00:56:12 +0000 (+0000) Subject: krb5int_get_plugin_dir_data() uses + instead of * in realloc X-Git-Tag: krb5-1.5-beta1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=218cd01853820bc9bcd6700f0d3b98458eb7c8a9;p=thirdparty%2Fkrb5.git 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 --- diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c index 0945d3995f..de659cb1a2 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 {