From 33522029d7c020aa3ef72f5b5400cb7c90fc52d8 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 18 Apr 2013 22:24:24 +0300 Subject: [PATCH] Allocate right amount of space in malloc(). This happened to be just harmless waste of memory, because sizeof(ParameterInfoClass) > sizeof(ParameterImplClass), but it was clearly wrong. Found by Coverity scan. --- descriptor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/descriptor.c b/descriptor.c index b5bc7b5..386e621 100644 --- a/descriptor.c +++ b/descriptor.c @@ -416,7 +416,7 @@ static void IPDFields_copy(const IPDFields *src, IPDFields *target) { int i; - target->parameters = (ParameterImplClass *) malloc(target->allocated * sizeof(ParameterInfoClass)); + target->parameters = (ParameterImplClass *) malloc(target->allocated * sizeof(ParameterImplClass)); for (i = 0; i < target->allocated; i++) ParameterImplClass_copy(&src->parameters[i], &target->parameters[i]); } -- 2.39.5