From: Howard Chu Date: Tue, 13 Feb 2007 11:27:06 +0000 (+0000) Subject: Coverity - check for malloc failure (however unlikely...) X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d38f2d8096c3906e731b73606bf1b19211d2b0b0;p=openldap Coverity - check for malloc failure (however unlikely...) --- diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index 06a636f812..ee59c0f7dc 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -434,6 +434,9 @@ process_ldif_rec( char *rbuf, int linenum ) lines = ldif_countlines( rbuf ); btype = ber_memcalloc( 1, (lines+1)*2*sizeof(struct berval)+lines ); + if ( !btype ) + return LDAP_NO_MEMORY; + vals = btype+lines+1; freeval = (char *)(vals+lines+1); i = -1;