--- a/src/server/config/mimeconf.c Sun Dec 14 20:37:11 2025 +0100 +++ b/src/server/config/mimeconf.c Wed Dec 17 22:15:48 2025 +0100 @@ -44,6 +44,10 @@ } MimeConfig *conf = malloc(sizeof(MimeConfig)); + if(!conf) { + return NULL; + } + memset(conf, 0, sizeof(MimeConfig)); conf->parser.parse = mimeconf_parse; conf->directives_begin = NULL; conf->directives_end = NULL; @@ -52,8 +56,8 @@ if(r != 0) { ws_cfg_log(LOG_FAILURE, "Cannot parse mime config file %s", file); fclose(in); + free_mime_config(conf); free(conf); - // TODO: free return NULL; }