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>
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) {
start_client_init(vs);
}
+
+ qcrypto_cipher_free(cipher);
return 0;
reject:
}
vnc_flush(vs);
vnc_client_error(vs);
+ qcrypto_cipher_free(cipher);
return 0;
}