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:
5ac848e
)
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, 17 Nov 2012 18:14:19 +0000
(10:14 -0800)
lib/socket.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/socket.c
b/lib/socket.c
index 1bb34f0ef9e57212d7919d4fee3d0d524c3488f6..8ad5e4e891b3814bd899c500dc9d5546e7e7d570 100644
(file)
--- a/
lib/socket.c
+++ b/
lib/socket.c
@@
-599,6
+599,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);