add: endpoint /tags
fix: leaks from config (now using static length for config strings)
This commit is contained in:
parent
0f1cd9c02c
commit
a78815cb32
10 changed files with 147 additions and 16 deletions
5
config.c
5
config.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue