#include <conn_settings.h>
When filling the value union, you must allocate new space for string_val, byte_array.val and list_val as the conn_settings_value_destroy() will deallocate that memory.