winbind: Fix Coverity ID 1398910
authorVolker Lendecke <vl@samba.org>
Wed, 15 Nov 2023 13:48:20 +0000 (14:48 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 21 Nov 2023 17:34:36 +0000 (17:34 +0000)
Coverity isn't smart enough for talloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/winbindd_ads.c

index d7a665abbc6d6edf0db33da88fbd0fd226fc8266..7e572e5d41f48168925f8783947d253d76d2bc37 100644 (file)
@@ -449,6 +449,8 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
        rids = talloc_realloc(mem_ctx, rids, uint32_t, count);
        if (prids != NULL) {
                *prids = rids;
+       } else {
+               TALLOC_FREE(rids);
        }
 
        status = NT_STATUS_OK;