From d38f2d8096c3906e731b73606bf1b19211d2b0b0 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 13 Feb 2007 11:27:06 +0000 Subject: [PATCH] Coverity - check for malloc failure (however unlikely...) --- clients/tools/ldapmodify.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.5