Browse Source

* f2b_*_destroy() : fixes

master
Alex 'AdUser' Z 4 years ago
parent
commit
2f3d0085e0
  1. 3
      src/backend.c
  2. 3
      src/filter.c
  3. 3
      src/source.c

3
src/backend.c

@ -121,8 +121,11 @@ f2b_backend_init(f2b_backend_t *backend, f2b_config_section_t *config) {
void void
f2b_backend_destroy(f2b_backend_t *backend) { f2b_backend_destroy(f2b_backend_t *backend) {
if (!backend) return; if (!backend) return;
if (backend->h) {
if (backend->cfg)
backend->destroy(backend->cfg); backend->destroy(backend->cfg);
dlclose(backend->h); dlclose(backend->h);
}
free(backend); free(backend);
} }

3
src/filter.c

@ -180,8 +180,11 @@ f2b_filter_init(f2b_filter_t *filter, f2b_config_section_t *config) {
void void
f2b_filter_destroy(f2b_filter_t *filter) { f2b_filter_destroy(f2b_filter_t *filter) {
if (!filter) return; if (!filter) return;
if (filter->h) {
if (filter->cfg)
filter->destroy(filter->cfg); filter->destroy(filter->cfg);
dlclose(filter->h); dlclose(filter->h);
}
free(filter); free(filter);
} }

3
src/source.c

@ -117,8 +117,11 @@ f2b_source_init(f2b_source_t *source, f2b_config_section_t *config) {
void void
f2b_source_destroy(f2b_source_t *source) { f2b_source_destroy(f2b_source_t *source) {
if (!source) return; if (!source) return;
if (source->h) {
if (source->cfg)
source->destroy(source->cfg); source->destroy(source->cfg);
dlclose(source->h); dlclose(source->h);
}
free(source); free(source);
} }

Loading…
Cancel
Save