aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-05-30 02:15:19 +0100
committerJonathan McCrohan <jmccrohan@gmail.com>2012-05-30 02:15:19 +0100
commit2739fd0e2955872afdf9a5c4ebc3a0c5411f6fcb (patch)
treeee13b66c2f87676e3cb994b35bf0bc0ceb28c5c5 /src
parent8af07ddee9d521709ff3b950af728ec6c6b19efc (diff)
downloadverteco-2739fd0e2955872afdf9a5c4ebc3a0c5411f6fcb.tar.gz
modbuslog: free fd upon failed read
Diffstat (limited to '')
-rw-r--r--src/modbuslog.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/modbuslog.c b/src/modbuslog.c
index da03a11..f179a0b 100644
--- a/src/modbuslog.c
+++ b/src/modbuslog.c
@@ -299,6 +299,8 @@ int main(int argc, char *argv[]) {
if (rc == -1){
// retried, but still no luck
+ modbus_close(ctx);
+ modbus_free(ctx);
continue;
}