summaryrefslogblamecommitdiffstats
path: root/free_ldapsearchfilter.c
blob: d952f93242f40b6bfc1889fcb62fdd99537fc6de (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                              


                                                






                   
#include <stdlib.h>
#include "ldap.h"

void free_ldapsearchfilter(struct Filter* f) {
  while (f) {
    struct Filter* tmp=f->next;
    switch (f->type) {
    case AND: case OR: case NOT:
      free_ldapsearchfilter(f->x);
      break;
    case SUBSTRING:
      while (f->substrings) {
	struct Substring* s=f->substrings->next;
	free(f->substrings);
	f->substrings=s;
      }
    default:
      break;
    }
    free(f); f=tmp;
  }
}