diff options
author | Gonglei <arei.gonglei@huawei.com> | 2015-07-22 17:08:53 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-24 13:57:44 +0200 |
commit | 60928458e5eea3c77a7eb0a4194927872f463947 (patch) | |
tree | 873eeb9984af2ee979b6ade0f23efc53620ced48 /ui/vnc.c | |
parent | 4bf1cb03fbc43b0055af60d4ff093d6894aa4338 (diff) | |
download | qemu-60928458e5eea3c77a7eb0a4194927872f463947.tar.gz qemu-60928458e5eea3c77a7eb0a4194927872f463947.tar.bz2 qemu-60928458e5eea3c77a7eb0a4194927872f463947.zip |
vnc: fix memory leak
If vnc's password is configured, it will leak memory
which cipher variable pointed on every vnc connection.
Cc: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Message-Id: <1437556133-11268-1-git-send-email-arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'ui/vnc.c')
-rw-r--r-- | ui/vnc.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2520,7 +2520,7 @@ static int protocol_client_auth_vnc(VncState *vs, uint8_t *data, size_t len) size_t i, pwlen; unsigned char key[8]; time_t now = time(NULL); - QCryptoCipher *cipher; + QCryptoCipher *cipher = NULL; Error *err = NULL; if (!vs->vd->password) { @@ -2573,6 +2573,8 @@ static int protocol_client_auth_vnc(VncState *vs, uint8_t *data, size_t len) start_client_init(vs); } + + qcrypto_cipher_free(cipher); return 0; reject: @@ -2584,6 +2586,7 @@ reject: } vnc_flush(vs); vnc_client_error(vs); + qcrypto_cipher_free(cipher); return 0; } |