1
0
mirror of https://github.com/falk-werner/webfused synced 2026-03-02 04:09:19 +00:00

fix: copy items when init from another list

This commit is contained in:
Falk Werner
2020-11-13 21:49:28 +01:00
parent d8879cf1d9
commit fa46f9fd6e
3 changed files with 33 additions and 2 deletions

View File

@@ -219,7 +219,7 @@ wfd_config_read_mountoptions(
config_setting_t * filesystem,
struct wfd_string_list * mount_options)
{
config_setting_t * list = config_setting_get_member(filesystem, "mountpoint_options");
config_setting_t * list = config_setting_get_member(filesystem, "mount_options");
if ((NULL != list) && (CONFIG_TRUE == config_setting_is_list(list)))
{
int length = config_setting_length(list);

View File

@@ -24,7 +24,10 @@ wfd_string_list_init_copy(
list->capacity = other->capacity;
list->items = malloc(sizeof(char *) * list->capacity);
memcpy(list->items, other->items, (sizeof(char*) * list->size));
for(size_t i = 0; i < other->size; i++)
{
list->items[i] = strdup(other->items[i]);
}
}
else
{