update examples

This commit is contained in:
Sergio R. Caprile committed 2025-06-24 16:26:31 -03:00
1 parent 074ef5197b
commit f5e2c68c8b
27 files changed
+166 -47

No files matched your search

+5 -2
View File
@@ -24,8 +24,8 @@ static struct 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);
mg_free(*value);
*value = jval;
}
}
@@ -61,5 +61,8 @@ int main(void) {
mg_http_listen(&mgr, s_http_addr, fn, NULL); // Create HTTP listener
for (;;) mg_mgr_poll(&mgr, 1000); // Infinite event loop
mg_mgr_free(&mgr);
mg_free(s_config.url);
mg_free(s_config.pub);
mg_free(s_config.sub);
return 0;
}