fd = safe_mkstemp(path, 0700, (uid_t)-1, (gid_t)-1);
if (fd == -1) {
i_error("safe_mkstemp(%s) failed: %m", str_c(path));
- (void)config_export_all_parsers(&export_ctx, §ion_idx);
+ config_export_free(&export_ctx);
str_free(&dump_ctx.delayed_output);
return -1;
}
i_unreached();
}
-static void config_export_free(struct config_export_context *ctx)
+void config_export_free(struct config_export_context **_ctx)
{
+ struct config_export_context *ctx = *_ctx;
+
+ *_ctx = NULL;
+
if (ctx->dup_parsers != NULL)
config_filter_parsers_free(ctx->dup_parsers);
hash_table_destroy(&ctx->keys);
*_ctx = NULL;
if (ctx->failed) {
- config_export_free(ctx);
+ config_export_free(&ctx);
return -1;
}
}
}
*section_idx = ctx->section_idx;
- config_export_free(ctx);
+ config_export_free(&ctx);
return ret;
}
const char *config_export_get_base_dir(struct config_export_context *ctx);
int config_export_all_parsers(struct config_export_context **ctx,
unsigned int *section_idx);
+void config_export_free(struct config_export_context **ctx);
#endif