X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Fliblutil%2Fldif.c;h=bb5ab7e1a1da65cce3f9708ab4d44417f143571b;hb=10595e7e5877b224077ae388913f96dbf26e9138;hp=361a5a37b261c9c795e2e8c7b9c9cd53456910ca;hpb=9446f8554b7173c2b73a6e7710e95c89808bbefb;p=openldap diff --git a/libraries/liblutil/ldif.c b/libraries/liblutil/ldif.c index 361a5a37b2..bb5ab7e1a1 100644 --- a/libraries/liblutil/ldif.c +++ b/libraries/liblutil/ldif.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2006 The OpenLDAP Foundation. + * Copyright 1998-2007 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -865,6 +865,10 @@ ldif_read_record( fp2 = ldif_open_url( ptr ); if ( fp2 ) { LDIFFP *lnew = ber_memalloc( sizeof( LDIFFP )); + if ( lnew == NULL ) { + fclose( fp2 ); + return 0; + } lnew->prev = lfp->prev; lnew->fp = lfp->fp; lfp->prev = lnew; @@ -876,7 +880,9 @@ ldif_read_record( /* We failed to open the file, this should * be reported as an error somehow. */ - break; + ber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug, + _("ldif_read_record: include %s failed\n"), ptr ); + return 0; } } }