idmap_cache: Only touch "sid" on success in find_xid_to_sid
authorVolker Lendecke <vl@samba.org>
Tue, 26 Feb 2019 11:46:39 +0000 (12:46 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 28 Feb 2019 12:57:23 +0000 (12:57 +0000)
commit4faf3e9f6da7515fc263d79f77226d105c2f8524
tree16016f219ab9b40f8578712a69a8a5ef8744f229
parentd9303e8eb90d48f09f2e2e8bdf01f4a7c3c21d11
idmap_cache: Only touch "sid" on success in find_xid_to_sid

Why? This makes the negative mapping condition (is_null_sid) more
explicit in the code.

The callers in lookup_sid initialized "psid" anyway before, and the ones
in wb_xids2sids now do as well. This is more in line with other APIs we
have: Only touch output parameters if you have something to say.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13813
source3/lib/idmap_cache.c
source3/winbindd/wb_xids2sids.c