dot11decrypt: Fix a resource leak on error path

Coverity CID 1450217

Change-Id: I51a3c3cca5c3850a2f8e9de5b4cca9f0efaca4a8
Reviewed-on: https://code.wireshark.org/review/36705
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Mikael Kanstrup 2020-04-03 14:46:34 +02:00 committed by Anders Broman
parent 3f51380b3b
commit 9bd47b765d
1 changed files with 1 additions and 0 deletions

View File

@ -385,6 +385,7 @@ Dot11DecryptRc4KeyData(const guint8 *decryption_key, guint decryption_key_len,
}
decrypted_key = (guint8 *)g_memdup(encrypted_keydata, encrypted_keydata_len);
if (!decrypted_key) {
gcry_cipher_close(rc4_handle);
return NULL;
}