diff options
author | Endi S. Dewata <edewata@redhat.com> | 2010-07-09 20:31:15 -0500 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-20 11:48:59 -0700 |
commit | 9e1b7533a8958b70b4ed1ecbd043934815dc8049 (patch) | |
tree | 6c3b6924a72ea4eab83fe476dc21dcd1f756e3e5 /ldap/servers/slapd/back-ldbm | |
parent | 7c9b3a5ac8bf75ed1ac0eed350691d41b9607ff5 (diff) | |
download | ds-9e1b7533a8958b70b4ed1ecbd043934815dc8049.tar.gz ds-9e1b7533a8958b70b4ed1ecbd043934815dc8049.tar.xz ds-9e1b7533a8958b70b4ed1ecbd043934815dc8049.zip |
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().
Diffstat (limited to 'ldap/servers/slapd/back-ldbm')
-rw-r--r-- | ldap/servers/slapd/back-ldbm/archive.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |