From: Pierangelo Masarati Date: Tue, 29 Mar 2005 11:43:36 +0000 (+0000) Subject: don't continue if fopen failed X-Git-Tag: OPENLDAP_AC_BP~1043 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=40ec0992d697eeb2cfd708a74c978cadb03deb59;p=openldap don't continue if fopen failed --- diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index 80146064fc..4cca3cd1ab 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -224,7 +224,8 @@ static int spew_entry(Entry * e, struct berval * path) { static Entry * get_entry_for_fd(int fd, struct berval *pdn, - struct berval *pndn) { + struct berval *pndn) +{ char * entry = (char *) slurp_file(fd); Entry * ldentry = NULL; @@ -270,7 +271,12 @@ static Entry * get_entry(Operation *op, struct berval *base_path) { if(path.bv_val != NULL) SLAP_FREE(path.bv_val); - return get_entry_for_fd(fd, &pdn, &pndn); + + if ( fd != -1 ) { + return get_entry_for_fd(fd, &pdn, &pndn); + } + + return NULL; } static void fullpath(struct berval *base, struct berval *name, struct berval *res) {