projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move the Mac port over to using snew/snewn/sresize.
[u/mdw/putty]
/
mac
/
otnet.c
diff --git
a/mac/otnet.c
b/mac/otnet.c
index
06fbea2
..
809906b
100644
(file)
--- a/
mac/otnet.c
+++ b/
mac/otnet.c
@@
-81,7
+81,7
@@
void ot_cleanup(void)
SockAddr ot_namelookup(char const *host, char **canonicalname)
{
SockAddr ot_namelookup(char const *host, char **canonicalname)
{
- SockAddr ret = s
malloc(sizeof(struct SockAddr_tag)
);
+ SockAddr ret = s
new(struct SockAddr_tag
);
char *realhost;
/* Casting away const -- hope OTInetStringToAddress is sensible */
char *realhost;
/* Casting away const -- hope OTInetStringToAddress is sensible */
@@
-93,14
+93,14
@@
SockAddr ot_namelookup(char const *host, char **canonicalname)
realhost = ret->hostinfo.name;
else
realhost = "";
realhost = ret->hostinfo.name;
else
realhost = "";
- *canonicalname = s
malloc(1+strlen(realhost)
);
+ *canonicalname = s
newn(1+strlen(realhost), char
);
strcpy(*canonicalname, realhost);
return ret;
}
SockAddr ot_nonamelookup(char const *host)
{
strcpy(*canonicalname, realhost);
return ret;
}
SockAddr ot_nonamelookup(char const *host)
{
- SockAddr ret = s
malloc(sizeof(struct SockAddr_tag)
);
+ SockAddr ret = s
new(struct SockAddr_tag
);
ret->resolved = FALSE;
ret->error = kOTNoError;
ret->resolved = FALSE;
ret->error = kOTNoError;
@@
-205,7
+205,7
@@
Socket ot_register(void *sock, Plug plug)
Actual_Socket ret;
Actual_Socket ret;
- ret = s
malloc(sizeof(struct Socket_tag)
);
+ ret = s
new(struct Socket_tag
);
ret->fn = &fn_table;
ret->error = kOTNoError;
ret->plug = plug;
ret->fn = &fn_table;
ret->error = kOTNoError;
ret->plug = plug;
@@
-254,7
+254,7
@@
Socket ot_new(SockAddr addr, int port, int privport, int oobinline,
InetAddress dest;
TCall connectCall;
InetAddress dest;
TCall connectCall;
- ret = s
malloc(sizeof(struct Socket_tag)
);
+ ret = s
new(struct Socket_tag
);
ret->fn = &fn_table;
ret->error = kOTNoError;
ret->plug = plug;
ret->fn = &fn_table;
ret->error = kOTNoError;
ret->plug = plug;