libcli:smb2: Do not leak ptext on error
authorAndreas Schneider <asn@samba.org>
Mon, 13 Jul 2020 14:15:03 +0000 (16:15 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 19 Aug 2020 16:22:39 +0000 (16:22 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
libcli/smb/smb2_signing.c

index 623fc23fb18a6aafb6633f688192085ec2b78902..bba80817018b8ba2d4b961a6f2a5936aea090de4 100644 (file)
@@ -522,6 +522,7 @@ NTSTATUS smb2_signing_encrypt_pdu(struct smb2_signing_key *encryption_key,
 
                ctext = talloc_size(talloc_tos(), ctext_size);
                if (ctext == NULL) {
+                       TALLOC_FREE(ptext);
                        status = NT_STATUS_NO_MEMORY;
                        goto out;
                }