Possible memory leak in map_info3_to_validation
authorSwen Schillig <swen@vnet.ibm.com>
Fri, 25 May 2018 08:40:54 +0000 (10:40 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 20 Jun 2018 19:05:40 +0000 (21:05 +0200)
In case of a failing call to copy_netr_SamInfo3, the allocated memory
for "validation" needs to be free'd before returning.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 20 21:05:40 CEST 2018 on sn-devel-144

source3/rpc_client/util_netlogon.c

index c57979a126501824460a5ab0579e48786b7cf3f7..c5443ba0b09b9ec91dfe584b41411e5081fda358 100644 (file)
@@ -353,6 +353,7 @@ NTSTATUS map_info3_to_validation(TALLOC_CTX *mem_ctx,
                                    info3,
                                    &validation->sam3);
        if (!NT_STATUS_IS_OK(status)) {
+               TALLOC_FREE(validation);
                return status;
        }