Perform no operation on nl_object_free(NULL).

Passing a NULL pointer would cause a NULL pointer dereference within
nl_object_free().
Returning early on NULL pointer is the behavior free(3) and other
nl*_free() functions.

Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com>
(cherry picked from commit ea436445ad774179d6b3196e102907272f403da8)

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Fix leak of cb if nl_socket_alloc_cb() failed to allocate socket

- each *_get() should have corresponding *_put(). That rule was broken in nl_socket_alloc()
- Also, check if cb is NULL in nl_socket_set_cb (calls BUG())
(cherry picked from commit 33396faca5d48a0318cdd85b4da2c3b247063781)

Conflicts:
	lib/socket.c
Wrong calcultation in nla_reserve

There seams to be an error in the calculation of needed space for the message in nla_reserve. The current size of the message is counted twice: Once in NLMSG_ALIGN, once in the condition below.
This causes nla_put_* calls to be rejected if the allocation size of the message has been strictly calculated by the caller.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
(cherry picked from commit 979ea335b0141eb62682056be42ccb4b01e6e2a2)

Conflicts:
	lib/attr.c