Fix potential segmentation fault

Call the allocation assertion macro before dereferencing the socket
pointer.
Fix potential memory leak

Delete the socket if the initialization part of the socket creation
fails.
Merge pull request #871 from apyrgio/develop

Fix potential segfault/memleak
Added ZMQ_BUILD_TESTS to CMakeLists.txt to allow turning off tests. Useful when building ZMQ as a git submodule.
Merge pull request #874 from gyulalaszlo/cmake-switchable-tests

Added ZMQ_BUILD_TESTS to CMakeLists.txt to allow turning off tests.
Fix identity handling for inproc transport

Fixes #872
Merge pull request #876 from hurtonm/master

Fix identity handling for inproc transport
Revert "Fix potential memory leak"

This reverts commit 50d34e5653ade4f3f1623c86f1426aeb746ae564.
Merge pull request #881 from hintjens/master

Revert "Fix potential memory leak"
fix libzmq.pc generation under cmake

The ${libdir} was getting replaced/removed by configure_file() making pkg-config give bad flags: -L -lzmq
My fix was to add @ONLY to configure_file() so ${} style pkg-config substitutions are left alone.
In addition, I put the other typical ${} substitutions back into the libzmq.pc, since its now safe.
fix autotools out of tree build link issue on linux

added srcdir to --version-script=$(srcdir)/libzmq.vers
Fix hang on term when inproc is connected but never bound.
Bind pending connections on terminate outside lock.
Merge pull request #887 from ricnewton/master

Fix hang on terminate when inproc is connected but never bound.
Merge pull request #886 from guruofquality/auto_fixes

fix autotools out of tree build link issue on linux
Merge pull request #884 from guruofquality/cmake_fixes

fix libzmq.pc generation under cmake
Add ZMQ_MAX_SOCKETS_MAX to zmq_ctx_get()

The new options allows querying the maximum allowed number of sockets.
This is system dependent and cannot be encoded in the include file as a
preprocessor macro: for ZMQ_USE_SELECT, this depends on the FD_SETSIZE
macro at time of library compilation, not at time of include file use.
Fix a strict-aliasing with type-punning

Fixes #880
Revert "add proxy_chain, a multi proxies chaining in the same thread feature"

This reverts commit bc7441f5176589ad9a34dc2bde6b91d78a44e3e0.
Revert "add a proxy hook"

This reverts commit 9ae6a91fadb96fd48038fde04cc3d4b61b49a8a1.