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:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user