From 2b75390ad1ad7677a67c2a0dbd3d5e17cbc444d8 Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Wed, 14 Feb 2007 01:08:02 +0000
Subject: [PATCH] Fix bad coverity patch

---
 servers/slapd/syncrepl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c
index 1b313b5bbd..b5fef03d48 100644
--- a/servers/slapd/syncrepl.c
+++ b/servers/slapd/syncrepl.c
@@ -1629,7 +1629,8 @@ syncrepl_message_to_entry(
 	if ( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_DELETE ) {
 		/* NOTE: this could be done even before decoding the DN,
 		 * although encoding errors wouldn't be detected */
-		return LDAP_SUCCESS;
+		rc = LDAP_SUCCESS;
+		goto done;
 	}
 
 	if ( entry == NULL ) {
@@ -1733,7 +1734,8 @@ done:
 			e = NULL;
 		}
 	}
-	*entry = e;
+	if ( entry )
+		*entry = e;
 
 	return rc;
 }
-- 
GitLab