Skip to content

Commit

Permalink
GUACAMOLE-1686: Merge fix for file descriptor resource leak in WoL code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuehlner committed May 24, 2024
2 parents c91b0ef + 275ffbe commit fa448f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libguac/wol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;

}
}

0 comments on commit fa448f1

Please sign in to comment.