From 9ed455ca83f5a5c706d5ebab09fa4700e7da6c52 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Thu, 6 Dec 2012 11:41:29 -0500
Subject: [PATCH 21/22] Ticket 526 - Coverity Issues for 1.2.11
Reviewed by: richm(Thanks!)
(cherry picked from commit 39b0938b43a5dbfdc566b343e504585bad7de859)
---
ldap/servers/plugins/memberof/memberof.c | 7 +++++++
ldap/servers/slapd/back-ldbm/dblayer.c | 2 ++
lib/libaccess/acltools.cpp | 1 +
3 files changed, 10 insertions(+)
diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c
index 598f4d9..a3f875d 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -1105,6 +1105,13 @@ memberof_modop_one_replace_r(Slapi_PBlock *pb, MemberOfConfig *config,
const char *op_this = slapi_sdn_get_ndn(op_this_sdn);
Slapi_Value *to_dn_val = slapi_value_new_string(op_to);
Slapi_Value *this_dn_val = slapi_value_new_string(op_this);
+
+ if(this_dn_val == NULL || to_dn_val == NULL){
+ slapi_log_error( SLAPI_LOG_FATAL, MEMBEROF_PLUGIN_SUBSYSTEM,
+ "memberof_modop_one_replace_r: failed to get DN values (NULL)\n");
+ goto bail;
+ }
+
/* op_this and op_to are both case-normalized */
slapi_value_set_flags(this_dn_val, SLAPI_ATTR_FLAG_NORMALIZED_CIS);
slapi_value_set_flags(to_dn_val, SLAPI_ATTR_FLAG_NORMALIZED_CIS);
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 5452d6b..2fd2110 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1910,6 +1910,8 @@ dblayer_get_id2entry_size(ldbm_instance *inst)
ID2ENTRY LDBM_FILENAME_SUFFIX);
rc = PR_GetFileInfo(id2entry_file, &info);
slapi_ch_free_string(&id2entry_file);
+ if (inst_dirp != inst_dir)
+ slapi_ch_free_string(&inst_dirp);
if (rc) {
return 0;
}
diff --git a/lib/libaccess/acltools.cpp b/lib/libaccess/acltools.cpp
index 69d0c2e..df08658 100644
--- a/lib/libaccess/acltools.cpp
+++ b/lib/libaccess/acltools.cpp
@@ -1415,6 +1415,7 @@ char *errmsg;
eid = ACLERR1500;
errmsg = system_errmsg();
nserrGenerate(errp, rv, eid, ACL_Program, 2, "buffer", errmsg);
+ PERM_FREE(errmsg);
}
}
--
1.7.11.7