From ae567be0c295d9c18da5ba4be4f8403cc844a9a3 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 --- src/zmq.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/zmq.cpp') 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) -- cgit v1.2.3