GUACAMOLE-1686: Fix fd resource leak in WoL code.
This commit is contained in:
parent
c91b0efc9e
commit
275ffbe471
@ -212,6 +212,9 @@ int guac_wol_wake_and_wait(const char* mac_addr, const char* broadcast_addr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Close the fd to avoid resource leak. */
|
||||
close(sockfd);
|
||||
|
||||
/* Send the magic WOL packet and store return value. */
|
||||
int retval = guac_wol_wake(mac_addr, broadcast_addr, udp_port);
|
||||
|
||||
@ -243,4 +246,4 @@ int guac_wol_wake_and_wait(const char* mac_addr, const char* broadcast_addr,
|
||||
guac_error_message = "Unable to connect to remote host.";
|
||||
return -1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user