diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-12-18 16:32:16 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-12-18 16:32:16 +0100 |
commit | 2d07ccc14d3d8e52c115336d5ab88e45de2eef74 (patch) | |
tree | e86053790011ac2ac633aad88c0aa29d9a2ad468 /src | |
parent | f008aec73bf108fc4f27c22d89704fb3c9572b97 (diff) | |
download | dabmux-2d07ccc14d3d8e52c115336d5ab88e45de2eef74.tar.gz dabmux-2d07ccc14d3d8e52c115336d5ab88e45de2eef74.tar.bz2 dabmux-2d07ccc14d3d8e52c115336d5ab88e45de2eef74.zip |
Fix error handling in zmq readkey
Diffstat (limited to 'src')
-rw-r--r-- | src/dabInputZmq.cpp | 5 |
1 files 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'; |