summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Danihelka <ivo@danihelka.net>2010-08-26 12:14:53 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-04 16:58:29 +0200
commitae567be0c295d9c18da5ba4be4f8403cc844a9a3 (patch)
tree00754ea32997c7e2714a2131195c9856f0911cfe
parent51a84c15ded2d70985c9d971ebdf3f3c9c18d590 (diff)
improved null checking in zmq_term
-rw-r--r--AUTHORS1
-rw-r--r--src/zmq.cpp7
2 files changed, 5 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index 0256523..1279d7f 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -16,6 +16,7 @@ Erik Rigtorp <erik@rigtorp.com>
Frank Denis <zeromq@pureftpd.org>
George Neill <georgen@neillnet.com>
Gonzalo Diethelm <gdiethelm@dcv.cl>
+Ivo Danihelka <ivo@danihelka.net>
Joe Thornber <joe.thornber@gmail.com>
Jon Dyte <jon@totient.co.uk>
Kamil Shakirov <kamils80@gmail.com>
diff --git a/src/zmq.cpp b/src/zmq.cpp
index 8b21d4b..f3ccaac 100644
--- a/src/zmq.cpp
+++ b/src/zmq.cpp
@@ -272,13 +272,14 @@ void *zmq_init (int io_threads_)
int zmq_term (void *ctx_)
{
- int rc = ((zmq::ctx_t*) ctx_)->term ();
- int en = errno;
-
if (!ctx_) {
errno = EFAULT;
return -1;
}
+
+ int rc = ((zmq::ctx_t*) ctx_)->term ();
+ int en = errno;
+
#if defined ZMQ_HAVE_OPENPGM
// Shut down the OpenPGM library.
if (pgm_shutdown () != TRUE)