diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2007-10-02 23:21:31 +0000 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2007-10-02 23:21:31 +0000 |
commit | d3f1d6f85a0f1cc4430270cfb5c967e1bd54cb2d (patch) | |
tree | cb8a478052582d878221cdb8f9af0783126d03c3 /ldap/servers/slapd/back-ldbm | |
parent | 89bad9becdd0c183c9e5a17bf6338e4b66db16ac (diff) | |
download | ds-d3f1d6f85a0f1cc4430270cfb5c967e1bd54cb2d.tar.gz ds-d3f1d6f85a0f1cc4430270cfb5c967e1bd54cb2d.tar.xz ds-d3f1d6f85a0f1cc4430270cfb5c967e1bd54cb2d.zip |
Resolves: #314851
Summary: vlv: crash after repeated backend creation/deletion
Description: added a check code for the backend's existing.
Diffstat (limited to 'ldap/servers/slapd/back-ldbm')
-rw-r--r-- | ldap/servers/slapd/back-ldbm/vlv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ldap/servers/slapd/back-ldbm/vlv.c b/ldap/servers/slapd/back-ldbm/vlv.c index 500b093a..b8ba3f1a 100644 --- a/ldap/servers/slapd/back-ldbm/vlv.c +++ b/ldap/servers/slapd/back-ldbm/vlv.c @@ -76,6 +76,9 @@ int vlv_AddSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* struct vlvSearch* newVlvSearch= vlvSearch_new(); backend *be = inst->inst_be; + if (NULL == be) { /* backend is not associated */ + return SLAPI_DSE_CALLBACK_ERROR; + } vlvSearch_init(newVlvSearch, pb, entryBefore, inst); /* vlvSearchList is modified; need Wlock */ PR_RWLock_Wlock(be->vlvSearchList_lock); @@ -280,6 +283,9 @@ vlv_init_search_entry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e ldbm_instance *inst = (ldbm_instance*)arg; backend *be= inst->inst_be; + if (NULL == be) { /* backend is not associated */ + return SLAPI_DSE_CALLBACK_ERROR; + } vlvSearch_init(newVlvSearch, pb, entryBefore, inst); vlvSearch_addtolist(newVlvSearch, (struct vlvSearch **)&be->vlvSearchList); return SLAPI_DSE_CALLBACK_OK; |