audk/StdLib/BsdSocketLib
Daryl McDaniel 7053c3b3b3 StdLib/BsdSocketLib: Fix minor memory leak by freeing rrecp on error return.
The error return is triggered by one of two conditions:
  1.  rrecp is NULL (calloc failed)
  2.  strdup(dname) returns NULL

Previously, the function just returned NULL.  This patch adds a call to
free rrecp before returning NULL.  Since the free() function will properly
do nothing when called with a NULL parameter, it is not necessary to
separate the two tests into separate if clauses.

Reported-by: Colin King <colin.king@canonical.com>

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-02-17 16:11:29 -08:00
..
BsdSocketLib.inf Add missing IPv6 address definitions. 2012-06-14 18:16:01 +00:00
Ip6Addr_Any.c Add missing IPv6 address definitions. 2012-06-14 18:16:01 +00:00
Ip6Addr_LinkLocal_AllNodes.c Add missing IPv6 address definitions. 2012-06-14 18:16:01 +00:00
Ip6Addr_LinkLocal_AllRouters.c Add missing IPv6 address definitions. 2012-06-14 18:16:01 +00:00
Ip6Addr_Loopback.c Add missing IPv6 address definitions. 2012-06-14 18:16:01 +00:00
Ip6Addr_NodeLocal_AllNodes.c Add missing IPv6 address definitions. 2012-06-14 18:16:01 +00:00
SocketInternals.h * StdLib.dsc was changed to always build the sockets code. 2012-02-17 23:43:35 +00:00
Socklib_internals.h
accept.c
base64.c * StdLib.dsc was changed to always build the sockets code. 2012-02-17 23:43:35 +00:00
bind.c StdLib: Fix more GCC warnings/errors caused by variables being set but not used. 2014-10-31 17:50:33 +00:00
close.c Fixed close for socket to properly release the socket context structure and the handle. 2012-10-08 21:39:35 +00:00
connect.c
errno.c
getaddrinfo.c * StdLib.dsc was changed to always build the sockets code. 2012-02-17 23:43:35 +00:00
gethostbydns.c
gethostbyht.c
gethostbynis.c
gethostnamadr.c
gethostname.c
getnameinfo.c StdLib: Fix GCC warnings/errors caused by variables being set but not used. 2014-10-30 01:05:22 +00:00
getnetbydns.c
getnetbyht.c
getnetbynis.c
getnetnamadr.c
getpeername.c
getproto.c
getprotoent.c
getprotoname.c
getservbyname.c
getservbyport.c
getservent.c
getsockname.c
getsockopt.c StdLib: Fix more GCC warnings/errors caused by variables being set but not used. 2014-10-31 17:50:33 +00:00
herror.c
inet_net_ntop.c * StdLib.dsc was changed to always build the sockets code. 2012-02-17 23:43:35 +00:00
inet_net_pton.c
inet_neta.c
inet_pton.c
listen.c StdLib: Fix more GCC warnings/errors caused by variables being set but not used. 2014-10-31 17:50:33 +00:00
map_v4v6.c
ns_addr.c StdLib/BsdSocketLib: Fix function declaration mismatch with definition. 2014-12-02 21:30:41 +00:00
ns_name.c
ns_netint.c
ns_ntoa.c StdLib/BsdSocketLib: Fix function declaration mismatch with definition. 2014-12-02 21:30:41 +00:00
ns_parse.c StdLib: Fix possible compiler warnings when doing enumerate type comparison. 2012-09-03 01:07:54 +00:00
ns_print.c StdLib: Fix parameter type errors. 2014-09-17 20:58:16 +00:00
ns_ttl.c
nsap_addr.c
poll.c StdLib: Fix more GCC warnings/errors caused by variables being set but not used. 2014-10-31 17:50:33 +00:00
read.c * StdLib.dsc was changed to always build the sockets code. 2012-02-17 23:43:35 +00:00
recv.c
recvfrom.c
res_comp.c StdLib: Fix GCC warnings/errors caused by variables being set but not used. 2014-10-30 01:05:22 +00:00
res_config.h
res_data.c
res_debug.c StdLib: Fix parameter type errors. 2014-09-17 20:58:16 +00:00
res_init.c
res_mkquery.c
res_mkupdate.c StdLib/BsdSocketLib: Fix minor memory leak by freeing rrecp on error return. 2016-02-17 16:11:29 -08:00
res_query.c
res_send.c * StdLib.dsc was changed to always build the sockets code. 2012-02-17 23:43:35 +00:00
res_update.c StdLib: Fix more GCC warnings/errors caused by variables being set but not used. 2014-10-31 17:50:33 +00:00
send.c
sendto.c
sethostname.c
setsockopt.c StdLib: Fix more GCC warnings/errors caused by variables being set but not used. 2014-10-31 17:50:33 +00:00
shutdown.c
socket.c Fix sockets use of file descriptors which was broken by the additional validation in StdLib/LibC/Uefi/SysCall.c/write added by revision 13989. 2013-02-08 21:26:46 +00:00
write.c * StdLib.dsc was changed to always build the sockets code. 2012-02-17 23:43:35 +00:00