Fix file descriptor leak in Confd Client
authorKlaus Aehlig <aehlig@google.com>
Thu, 12 Feb 2015 13:40:37 +0000 (14:40 +0100)
committerKlaus Aehlig <aehlig@google.com>
Thu, 12 Feb 2015 15:20:23 +0000 (16:20 +0100)
commitee2b2eda5c1c238d475251a5b7f2143d4750dd86
treefa0133c108dd757cfde42fbdbbe154ae58bd620f
parent25fe44b78c2886a559f8fd4c2383db9d7bd1b36a
Fix file descriptor leak in Confd Client

The queryOneServer function opens a UDP socket to connect
to the specified confd server. However, it would never
close it. Fix this and do so in a bracket construction
to make sure it also gets cleaned up in case of errors.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
src/Ganeti/Confd/Client.hs