diff --git a/freefilter.c b/freefilter.c new file mode 100644 index 0000000..3a661b8 --- /dev/null +++ b/freefilter.c @@ -0,0 +1,15 @@ +#include "ldap.h" +#include + +void freefilter(struct Filter* f) { + if (f) { + while (f->a) { + struct AttributeList* a=f->a->next; + free(f->a); + f->a=a; + } + if (f->x) freefilter(f->x); + if (f->next) freefilter(f->next); + free(f); + } +}