diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-23 17:23:32 -0700 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-23 17:23:32 -0700 |
commit | 0712904f21d8c33daa55e35b3ea6f65a4fc59de6 (patch) | |
tree | 3f6d06fc35efca6b5fb23a7e562eeaf16673dd65 | |
parent | e4808ae72cffe024907651c5e0c897c1cfb71b88 (diff) | |
download | ds-0712904f21d8c33daa55e35b3ea6f65a4fc59de6.tar.gz ds-0712904f21d8c33daa55e35b3ea6f65a4fc59de6.tar.xz ds-0712904f21d8c33daa55e35b3ea6f65a4fc59de6.zip |
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
https://bugzilla.redhat.com/show_bug.cgi?id=611790
Resolves: bug 611790
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Fix description: Catch possible NULL pointer in ruv_get_replica_generation().
Note: committing the fix on behalf of Endi (edewata@redhat.com).
-rw-r--r-- | ldap/servers/plugins/replication/repl5_ruv.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c index 9f0d99a5..78f7a53b 100644 --- a/ldap/servers/plugins/replication/repl5_ruv.c +++ b/ldap/servers/plugins/replication/repl5_ruv.c @@ -825,14 +825,18 @@ ruv_get_replica_generation(const RUV *ruv) { char *return_str = NULL; - PR_RWLock_Rlock (ruv->lock); + if (!ruv) { + return return_str; + } + + PR_RWLock_Rlock (ruv->lock); if (ruv != NULL && ruv->replGen != NULL) { return_str = slapi_ch_strdup(ruv->replGen); } - PR_RWLock_Unlock (ruv->lock); + PR_RWLock_Unlock (ruv->lock); return return_str; } |