repositories
/
deb_libnfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3b77e1
)
Dont leak addrinfo in error path
author
Ronnie Sahlberg
<ronniesahlberg@gmail.com>
Fri, 16 Nov 2012 02:38:54 +0000
(13:38 +1100)
committer
Ronnie Sahlberg
<ronniesahlberg@gmail.com>
Sat, 24 Nov 2012 16:14:12 +0000
(08:14 -0800)
lib/socket.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/socket.c
b/lib/socket.c
index 3fa8378d9102b0127ded464dd9439d47258a7a53..32c09457c09b9189bf9c4bf65542dc4f860cd886 100644
(file)
--- a/
lib/socket.c
+++ b/
lib/socket.c
@@
-598,6
+598,7
@@
int rpc_set_udp_destination(struct rpc_context *rpc, char *addr, int port, int i
rpc->udp_dest = malloc(ai->ai_addrlen);
if (rpc->udp_dest == NULL) {
rpc_set_error(rpc, "Out of memory. Failed to allocate sockaddr structure");
+ freeaddrinfo(ai);
return -1;
}
memcpy(rpc->udp_dest, ai->ai_addr, ai->ai_addrlen);