GUACAMOLE-1686: Merge fix for file descriptor resource leak in WoL code.

This commit is contained in:
James Muehlner 2024-05-24 14:08:46 -07:00 committed by GitHub
commit fa448f13af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}
}