add: endpoint /tags

fix: leaks from config (now using static length for config strings)
This commit is contained in:
Tobias Reisinger 2020-06-13 19:21:32 +02:00
parent 0f1cd9c02c
commit a78815cb32
10 changed files with 147 additions and 16 deletions

View file

@ -61,31 +61,26 @@ config_load(IniDispatch *disp, void *config_void)
}
if(CONFINI_IS_KEY("core", "database"))
{
config->database = malloc(sizeof(char) * (strlen(disp->value) + 1));
strcpy(config->database, disp->value);
return 0;
}
if(CONFINI_IS_KEY("core", "not-found-file"))
{
config->not_found_file = malloc(sizeof(char) * (strlen(disp->value) + 1));
strcpy(config->not_found_file, disp->value);
return 0;
}
if(CONFINI_IS_KEY("core", "not-found-file-type"))
{
config->not_found_file_type = malloc(sizeof(char) * (strlen(disp->value) + 1));
strcpy(config->not_found_file_type, disp->value);
return 0;
}
if(CONFINI_IS_KEY("core", "not-found-content"))
{
config->not_found_content = malloc(sizeof(char) * (strlen(disp->value) + 1));
strcpy(config->not_found_content, disp->value);
return 0;
}
if(CONFINI_IS_KEY("core", "not-found-content-type"))
{
config->not_found_content_type = malloc(sizeof(char) * (strlen(disp->value) + 1));
strcpy(config->not_found_content_type, disp->value);
return 0;
}