We check if func is NULL, so if the allocation function failed we should
not dereference or handle it anymore, so we jump straight to the end.
Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
[Port from libusbg and update description] Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>