bring mg_strdup() back

This commit is contained in:
Sergio R. Caprile committed 2024-05-31 17:45:53 -03:00
1 parent a4e0225c69
commit ab75bfa6e7
11 files changed
+46 -16

No files matched your search

+1 -2
View File
@@ -5,8 +5,7 @@ void mg_rpc_add(struct mg_rpc **head, struct mg_str method,
void (*fn)(struct mg_rpc_req *), void *fn_data) {
struct mg_rpc *rpc = (struct mg_rpc *) calloc(1, sizeof(*rpc));
if (rpc != NULL) {
rpc->method.buf = mg_mprintf("%.*s", method.len, method.buf);
rpc->method.len = method.len;
rpc->method = mg_strdup(method);
rpc->fn = fn;
rpc->fn_data = fn_data;
rpc->next = *head, *head = rpc;