summaryrefslogtreecommitdiff
path: root/src
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 /src
parent51a84c15ded2d70985c9d971ebdf3f3c9c18d590 (diff)
improved null checking in zmq_term
Diffstat (limited to 'src')
-rw-r--r--src/zmq.cpp7
1 files changed, 4 insertions, 3 deletions
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)