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

+1 -1
View File
@@ -22,7 +22,7 @@ bool web_load_settings(void *buf, size_t len) {
} else {
memcpy(buf, data.buf, len);
}
free((void *) data.buf);
mg_free((void *) data.buf);
return ok;
}
+2 -2
View File
@@ -41,7 +41,7 @@ static void setfromjson(struct mg_str json, const char *jsonpath, char *buf,
size_t len) {
char *val = mg_json_get_str(json, jsonpath);
if (val != NULL) mg_snprintf(buf, len, "%s", val);
free(val);
mg_free(val);
}
static void handle_settings_set(struct mg_connection *c, struct mg_str body) {
@@ -159,7 +159,7 @@ static struct mg_connection *start_modbus_request(struct mg_mgr *mgr,
cd->id = cid; // Store parent connection ID
cd->expiration_time = mg_millis() + timeout;
}
free(url);
mg_free(url);
return c;
}