From 138daaa4b171b770e0372c19fb5f656309eea4b1 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 30 Jun 2010 14:18:36 -0600 Subject: Bug 609590 - fix coverity Defect Type: Memory - corruptions issues https://bugzilla.redhat.com/show_bug.cgi?id=609590 Resolves: bug 609590 Bug Description: fix coverity Defect Type: Memory - corruptions issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: The code wants to allocate space for a struct berval, not struct berval *. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no --- ldap/servers/slapd/tools/ldclt/ldapfct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c index b19c6895..4d1ac6a3 100644 --- a/ldap/servers/slapd/tools/ldclt/ldapfct.c +++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c @@ -1523,7 +1523,7 @@ buildNewModAttribFile ( { int nbAttribs; /* Nb of attributes */ LDAPMod attribute; /* To build the attributes */ - struct berval *bv = malloc(sizeof(struct berval *)); + struct berval *bv = malloc(sizeof(struct berval)); attribute.mod_bvalues = (struct berval **)malloc(2 * sizeof(struct berval *)); if ((bv == NULL) || (attribute.mod_bvalues == NULL)) { -- cgit