andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From 2cfe56f39c2e9892eb4f1372af9195449889dd17 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Mon, 8 Dec 2014 09:57:50 -0500
Subject: [PATCH 280/305] Ticket 47969 - Fix coverity issue

Description: Fix coverity issue 12948 & 12949 (NULL pointer dereference)

https://fedorahosted.org/389/ticket/47969

Reviewed by: mreynolds

(cherry picked from commit 1553b665bfecbbccd54c439442d9a22c5d35d4a1)
(cherry picked from commit ea01c960f0f32bead97fc3615c73f2cc3c4faba8)
---
 ldap/servers/plugins/cos/cos_cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index db34d15..10f475e 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -1906,9 +1906,9 @@ static void cos_cache_del_schema(cosCache *pCache)
 				cos_cache_del_attrval_list(&(pCache->ppAttrIndex[attr_index]->pObjectclasses));
 			}
 		}
+		/* Finally, remove the first attribute's objectclass list */
+		cos_cache_del_attrval_list(&(pCache->ppAttrIndex[0]->pObjectclasses));
 	}
-	/* Finally, remove the first attribute's objectclass list */
-	cos_cache_del_attrval_list(&(pCache->ppAttrIndex[0]->pObjectclasses));
 
 	LDAPDebug( LDAP_DEBUG_TRACE, "<-- cos_cache_del_schema\n",0,0,0);
 }
-- 
1.9.3