Probably a typo, checking 'ret' instead of the return value 'p'. This might cause the function to return failure, even though it succeeded. Furthermore, it might leak resources.
Instead, make sure that all callers log properly.
basic/ can be used by everything cannot use anything outside of basic/ libsystemd/ can use basic/ cannot use shared/ shared/ can use libsystemd/