void free_sa(struct db_sa *f) { unsigned int i; if(f == NULL) return; for(i=0; i<f->prop_conj_cnt; i++) { free_sa_prop_conj(&f->prop_conjs[i]); } if(f->prop_conjs) { pfree(f->prop_conjs); f->prop_conjs=NULL; f->prop_conj_cnt=0; } for(i=0; i<f->prop_disj_cnt; i++) { free_sa_v2_prop_disj(&f->prop_disj[i]); } if(f->prop_disj) { pfree(f->prop_disj); f->prop_disj=NULL; f->prop_disj_cnt=0; } if(f) { pfree(f); } }
void free_sa(struct db_sa *f) { if (f != NULL) { unsigned int i; if (f->prop_conjs != NULL) { for (i = 0; i < f->prop_conj_cnt; i++) free_sa_prop_conj(&f->prop_conjs[i]); pfree(f->prop_conjs); f->prop_conjs = NULL; f->prop_conj_cnt = 0; } if (f->prop_disj != NULL) { for (i = 0; i < f->prop_disj_cnt; i++) free_sa_v2_prop_disj(&f->prop_disj[i]); pfree(f->prop_disj); f->prop_disj = NULL; f->prop_disj_cnt = 0; } pfree(f); } }