#include "include/fmt_regex.h" ttail_datefmt* ttail_fmt_regex_init(ttail_options* options) { ttail_datefmt *res; res = malloc(sizeof(ttail_datefmt)); if(!res) { perror("Failed to allocate the dateformat"); goto ttail_fmt_regex_init_malloc_err; } res->name = malloc(sizeof(char)*(sizeof(TTAIL_FMT_REGEX_NAME))); if(!res->name) { perror("Failed to allocate the dateformat name"); goto ttail_fmt_regex_init_err; } return res; ttail_fmt_regex_init_err: free(res); ttail_fmt_regex_init_malloc_err: return NULL; }