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 Update the sockets library code 2011-09-30 23:02:35 +00:00
accept.c Update the sockets library code 2011-09-30 23:02:35 +00:00
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 Update the sockets library code 2011-09-30 23:02:35 +00:00
errno.c Update the sockets library code 2011-09-30 23:02:35 +00:00
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 Update the sockets library code 2011-09-30 23:02:35 +00:00
getproto.c
getprotoent.c
getprotoname.c
getservbyname.c
getservbyport.c
getservent.c
getsockname.c Update the sockets library code 2011-09-30 23:02:35 +00:00
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 Fix some errors detected by the GCC 4.4 compiler. 2012-02-10 03:30:41 +00:00
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 Fix some errors detected by the GCC 4.4 compiler. 2012-02-10 03:30:41 +00:00
ns_netint.c Fix some errors detected by the GCC 4.4 compiler. 2012-02-10 03:30:41 +00:00
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 Fix some errors detected by the GCC 4.4 compiler. 2012-02-10 03:30:41 +00:00
nsap_addr.c Fix some errors detected by the GCC 4.4 compiler. 2012-02-10 03:30:41 +00:00
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 Update the sockets library code 2011-09-30 23:02:35 +00:00
recvfrom.c Update the sockets library code 2011-09-30 23:02:35 +00:00
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 Update the sockets library code 2011-09-30 23:02:35 +00:00
sendto.c Update the sockets library code 2011-09-30 23:02:35 +00:00
sethostname.c Update the sockets library code 2011-09-30 23:02:35 +00:00
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 Update the sockets library code 2011-09-30 23:02:35 +00:00
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