From 9e1b7533a8958b70b4ed1ecbd043934815dc8049 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 9 Jul 2010 20:31:15 -0500 Subject: Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939 https://bugzilla.redhat.com/show_bug.cgi?id=613056 Resolves: bug 613056 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939 description: Catch possible NULL pointer in ldbm_back_archive2ldbm() and ldbm_back_ldbm2archive(). --- ldap/servers/slapd/back-ldbm/archive.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ldap') diff --git a/ldap/servers/slapd/back-ldbm/archive.c b/ldap/servers/slapd/back-ldbm/archive.c index 54274539..f048a6fc 100644 --- a/ldap/servers/slapd/back-ldbm/archive.c +++ b/ldap/servers/slapd/back-ldbm/archive.c @@ -145,7 +145,7 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) inst = (ldbm_instance *)object_get_data(inst_obj2); instance_set_not_busy(inst); } - object_release(inst_obj2); + if (inst_obj2 && inst_obj2 != inst_obj) object_release(inst_obj2); object_release(inst_obj); goto out; } @@ -219,7 +219,7 @@ int ldbm_back_archive2ldbm( Slapi_PBlock *pb ) bakup_dir = slapi_ch_smprintf("%s%ctmp_%010ld", directory, c, time(0)); LDAPDebug( LDAP_DEBUG_ANY, "archive2db: backup dir: %s\n", bakup_dir, 0, 0); - *p = c; + if (p) *p = c; slapi_pblock_set( pb, SLAPI_SEQ_VAL, bakup_dir ); slapi_pblock_set( pb, SLAPI_SEQ_TYPE, &skipinit ); @@ -419,7 +419,7 @@ int ldbm_back_ldbm2archive( Slapi_PBlock *pb ) inst = (ldbm_instance *)object_get_data(inst_obj2); instance_set_not_busy(inst); } - object_release(inst_obj2); + if (inst_obj2 && inst_obj2 != inst_obj) object_release(inst_obj2); object_release(inst_obj); goto err; } -- cgit