Utilise magic memory tree interface for src/ser_posix.c

This commit is contained in:
Stefan Rueger
2024-04-26 23:31:21 +01:00
parent 34efea1073
commit 80a7fa606c

View File

@@ -288,10 +288,7 @@ static int net_open(const char *port, union filedescriptor *fdp) {
struct addrinfo hints;
struct addrinfo *result, *rp;
if ((hstr = hp = strdup(port)) == NULL) {
pmsg_error("out of memory\n");
return -1;
}
hstr = hp = mmt_strdup(port);
/*
* As numeric IPv6 addresses use colons as separators, we need to
@@ -348,7 +345,7 @@ static int net_open(const char *port, union filedescriptor *fdp) {
freeaddrinfo(result);
error:
free(hp);
mmt_free(hp);
return ret;
}