~ubuntu-branches/ubuntu/wily/389-ds-base/wily-proposed

« back to all changes in this revision

Viewing changes to ldap/servers/slapd/back-ldbm/filterindex.c

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2014-07-08 15:50:11 UTC
  • mto: (19.1.1 experimental) (0.3.1)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20140708155011-48naeyka2x89ew8g
Tags: upstream-1.3.2.19
ImportĀ upstreamĀ versionĀ 1.3.2.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
399
399
        LDAPDebug(LDAP_DEBUG_TRACE, 
400
400
                      "fallback to eq index as pres index gave allids\n", 
401
401
                      0, 0, 0);
402
 
        idl_free(idl);
 
402
        idl_free(&idl);
403
403
        idl = index_range_read_ext(pb, be, type, indextype_EQUALITY,
404
404
                                   SLAPI_OP_GREATER_OR_EQUAL,
405
405
                                   NULL, NULL, 0, &txn, err, allidslimit);
481
481
                    else if (keys == NULL || keys[0] == NULL)
482
482
                    {
483
483
                        /* no keys */
484
 
                        idl_free (idl);
 
484
                        idl_free (&idl);
485
485
                        idl = idl_allids (be);
486
486
                    }
487
487
                    else
516
516
                            else
517
517
                            {
518
518
                                IDList* tmp = idl_intersection (be, idl2, idl3);
519
 
                                idl_free (idl2);
520
 
                                idl_free (idl3);
 
519
                                idl_free (&idl2);
 
520
                                idl_free (&idl3);
521
521
                                idl2 = tmp;
522
522
                            }
523
523
                            if (idl2 == NULL) break; /* look no further */
529
529
                        else if (idl2 != NULL)
530
530
                        {
531
531
                            IDList* tmp = idl_union (be, idl, idl2);
532
 
                            idl_free (idl);
533
 
                            idl_free (idl2);
 
532
                            idl_free (&idl);
 
533
                            idl_free (&idl2);
534
534
                            idl = tmp;
535
535
                        }
536
536
                    }
828
828
                {
829
829
                    LDAPDebug( LDAP_DEBUG_TRACE,
830
830
                        "<= list_candidates NULL\n", 0, 0, 0 );
831
 
                    idl_free( idl );
 
831
                    idl_free( &idl );
832
832
                    idl = NULL;
833
833
                    goto out;
834
834
                }
838
838
                == NULL && ftype == LDAP_FILTER_AND ) {
839
839
                    LDAPDebug( LDAP_DEBUG_TRACE,
840
840
                        "<= list_candidates NULL\n", 0, 0, 0 );
841
 
                    idl_free( idl );
 
841
                    idl_free( &idl );
842
842
                    idl = NULL;
843
843
                    goto out;
844
844
            }
862
862
                    int notin_result = 0;
863
863
                    notin_result = idl_notin( be, idl, tmp, &new_idl );
864
864
                    if (notin_result) {
865
 
                        idl_free(idl);
 
865
                        idl_free(&idl);
866
866
                        idl = new_idl;
867
867
                    }
868
868
                }
869
869
            } else {
870
870
                idl = idl_intersection(be, idl, tmp);
871
 
                idl_free( tmp2 );
 
871
                idl_free( &tmp2 );
872
872
            }
873
 
            idl_free( tmp );
 
873
            idl_free( &tmp );
874
874
            /* stop if the list has gotten too small */
875
875
            if ((idl == NULL) ||
876
876
                (idl_length(idl) <= FILTER_TEST_THRESHOLD))
880
880
            slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
881
881
 
882
882
            idl = idl_union( be, idl, tmp );
883
 
            idl_free( tmp );
884
 
            idl_free( tmp2 );
 
883
            idl_free( &tmp );
 
884
            idl_free( &tmp2 );
885
885
            /* stop if we're already committed to an exhaustive
886
886
             * search. :(
887
887
             */
890
890
            if (op_is_pagedresults(operation)) {
891
891
                int nids = IDL_NIDS(idl);
892
892
                if ( allidslimit > 0 && nids > allidslimit ) {
893
 
                    idl_free( idl );
 
893
                    idl_free( &idl );
894
894
                    idl = idl_allids( be );
895
895
                }
896
896
            }
1013
1013
        }
1014
1014
#endif
1015
1015
        if ( idl2 == NULL ) {
1016
 
            idl_free( idl );
 
1016
            idl_free( &idl );
1017
1017
            idl = NULL;
1018
1018
            break;
1019
1019
        }
1025
1025
 
1026
1026
            tmp = idl;
1027
1027
            idl = idl_intersection(be, idl, idl2);
1028
 
            idl_free( idl2 );
1029
 
            idl_free( tmp );
 
1028
            idl_free( &idl2 );
 
1029
            idl_free( &tmp );
1030
1030
            if ( idl == NULL ) {
1031
1031
                break;
1032
1032
            }