mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-26 22:52:34 +02:00
CID1130009: Resource leak in sp_opensocket()
Corresponding to flashrom svn r1775. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
parent
a9c2342791
commit
b879287c42
@ -100,6 +100,7 @@ static int sp_opensocket(char *ip, unsigned int port)
|
|||||||
if (NULL == hostPtr) {
|
if (NULL == hostPtr) {
|
||||||
hostPtr = gethostbyaddr(ip, strlen(ip), AF_INET);
|
hostPtr = gethostbyaddr(ip, strlen(ip), AF_INET);
|
||||||
if (NULL == hostPtr) {
|
if (NULL == hostPtr) {
|
||||||
|
close(sock);
|
||||||
msg_perr("Error: cannot resolve %s\n", ip);
|
msg_perr("Error: cannot resolve %s\n", ip);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user