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
Ip6Addr_Any.c
Ip6Addr_LinkLocal_AllNodes.c
Ip6Addr_LinkLocal_AllRouters.c
Ip6Addr_Loopback.c
Ip6Addr_NodeLocal_AllNodes.c
SocketInternals.h
Socklib_internals.h
accept.c
base64.c
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
connect.c
errno.c
getaddrinfo.c
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
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
ns_print.c
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
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
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
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
write.c