Fix former config value not being freed

This commit is contained in:
Sergio R. Caprile committed 2022-07-18 16:21:02 -03:00
1 parent 89afe62121
commit 1651d9d6d9
1 file changed
+1
+1
View File
@@ -22,6 +22,7 @@ static struct config { char *url, *pub, *sub; } s_config;
static void update_config(struct mg_str json, const char *path, char **value) {
char *jval;
if ((jval = mg_json_get_str(json, path)) != NULL) {
free(*value);
*value = strdup(jval);
}
}