Problem: string buffers aren't NULL checked
check more allocations against NULL
alloc fixups
style and code fixups
zmq_msg_data casting fixup
revert unneeded changes
fix typo
Merge pull request #828 from jemc/master

Problem: zbeacon.c doesn't use self->poller
fix leaking file handle

Also updated zdir and zfile to check for truthness first
@xaqq according to the comment at the top of the function the filename
shall be stored even when a error occurs?
Wouldn’t a free(filename_copy) also nullify self->filename?
Merge branch 'master' into strndup
Merge pull request #824 from Asmod4n/strndup

Problem: string buffers aren't NULL checked
Problem: strndup is not available on all system
Solution: revert to previous duplication code
Problem: mingw32 is relying as well on the typedef for int[32|64]/uint[32|64]
Solution: add them for mingw build as well
Merge pull request #829 from sappo/master

Problem: strndup is not available on all system
Problem: allocated string buffers are not NULL checked

Solution: check if malloc doesn’t return NULL
Problem: mingw 64Bit relies on int[32/64]/uint[32/64] definitions
whereas mingw 32Bit does not.
Solution: include those defines in case of mingw 64Bit and exclude them
in case of mingw 32Bit.
Merge pull request #830 from Asmod4n/master

Problem: allocated string buffers are not NULL checked
Merge pull request #831 from sappo/master

Problem: mingw 64Bit relies on int[32/64]/uint[32/64] definitions whereas mingw 32Bit does not.
Problem: zsys_allocs is not defined as external

Solution: define properly in zsys.h.

Fixes #832
Merge pull request #833 from hintjens/master

Problem: zsys_allocs is not defined as external