From b212a43bb2d4eed6780cc93394fa566a09018a68 Mon Sep 17 00:00:00 2001
From: Vito Caputo <vcaputo@pengaru.com>
Date: Sat, 5 Aug 2023 12:52:20 -0700
Subject: til: use set_raw_value() in randomize_setup() overrides

Missed this in the last round of moving things to the
new raw_value() setter/getter api

This snippet of copy-n-pasta the few setup front-ends continue to
have should really be factored out into a libtil helper
---
 src/til.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/til.c b/src/til.c
index ea1e5fb..4fa42dd 100644
--- a/src/til.c
+++ b/src/til.c
@@ -539,8 +539,10 @@ int til_module_setup_randomize(const til_module_t *module, til_settings_t *setti
 					return -ENOMEM;
 
 				if (o != setting->value) {
-					free((void *)setting->value);
-					setting->value = o;
+					r = til_setting_set_raw_value(setting, o);
+					free((void *)o);
+					if (r < 0)
+						return -ENOMEM;
 				}
 			}
 
-- 
cgit v1.2.3