nfs_opendir_cb: plug potential memory leak

Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_lookuppath_async: plug potential memleak

Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_mknod_async: plug potential memory leak

Pointed out by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_creat_async: plug potential memleak

Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_fchown_async: plug potential memleak

Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_fchown_async: fix nullptr dereference

nfs_chown_data is hooked up under nfs_cb_data->continue_data but
no ->free_continue_data is configured, so once free_nfs_cb_data is
invoked it will trip over a nullptr.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
free_nfs_cb_data: add assert(data->free_continue_data)

Non-debug builds will trip over the nullptr too - do we rather
want to leak the memory there?

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
free_nfs_cb_data: make static and drop superfluous nullptr checks / assignments

free() can cope with nullptrs and there's no point in null-ing free'd members
as the containing struct is free'd as well.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_opendir2_cb: plug potential memleaks

Spotted by clang analyzer

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_fchmod_async: fix use-after-free

Spotted by clang analyzer

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_fchown_async: fix use-after-free

Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_mknod_async: fix use-after-free

Spotted by clang analyzer

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_mkdir_async: fix potential memory leak

Pointed out by clang analyzer

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_rmdir_async: fix potential memory leak

Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_unlink_async: plug potential memory leak

Spotted by clang analyzer

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_rename_continue_1_internal: fix use-after-free

Spotted by clang analyzer.
This introduces another allocation to create a copy of the target path
of a rename in case it needs to be reported via rpc_set_error - it might
be a better idea to avoid the allocation and have a slightly less informative
error message?

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
{nfs,rpc}_set_error: add __attribute__((format(printf))) annotations

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
socket.c: fix format string issues (too few arguments)

These were uncovered by the previously added __attribute__((format(printf))).

Emacs also removed trailing whitespace while at it.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
rpc_read_from_socket: fix use-after-free due to missing return

Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
nfs_write_async: plug potential memory leaks

Spotted by clang analyzer.

This also introduces asserts to help clang analyzer avoid
reporting false positives.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>