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-08-26 12:14:53 +0200
commit43f2c6ff5b15d6feae2bd608e50503f7d4c62682 (patch)
tree5200cbc047a0c0a125d835d5f79cf2658996d703 /src
parentb608c19c5a28f0f49a106bfddf680f0a410df6c8 (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 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)