From 2d07ccc14d3d8e52c115336d5ab88e45de2eef74 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 18 Dec 2015 16:32:16 +0100 Subject: Fix error handling in zmq readkey --- src/dabInputZmq.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dabInputZmq.cpp b/src/dabInputZmq.cpp index 5c20baf..e5a1654 100644 --- a/src/dabInputZmq.cpp +++ b/src/dabInputZmq.cpp @@ -71,9 +71,10 @@ int readkey(string& keyfile, char* key) if (fd < 0) return fd; int ret = read(fd, key, CURVE_KEYLEN); - if (ret < 0) - return ret; close(fd); + if (ret < 0) { + return ret; + } /* It needs to be zero-terminated */ key[CURVE_KEYLEN] = '\0'; -- cgit v1.2.3