From 43f2c6ff5b15d6feae2bd608e50503f7d4c62682 Mon Sep 17 00:00:00 2001 From: Ivo Danihelka Date: Thu, 26 Aug 2010 12:14:53 +0200 Subject: improved null checking in zmq_term --- AUTHORS | 1 + src/zmq.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index dd4e69a..38b1e82 100644 --- a/AUTHORS +++ b/AUTHORS @@ -15,6 +15,7 @@ Erik Rigtorp Frank Denis George Neill Gonzalo Diethelm +Ivo Danihelka Joe Thornber Jon Dyte Kamil Shakirov diff --git a/src/zmq.cpp b/src/zmq.cpp index e9bfc53..d5e9673 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -269,13 +269,14 @@ void *zmq_init (int io_threads_) int zmq_term (void *ctx_) { - int rc = ((zmq::ctx_t*) ctx_)->terminate (); - int en = errno; - if (!ctx_) { errno = EFAULT; return -1; } + + int rc = ((zmq::ctx_t*) ctx_)->terminate (); + int en = errno; + #if defined ZMQ_HAVE_OPENPGM // Shut down the OpenPGM library. if (pgm_shutdown () != TRUE) -- cgit v1.2.3