crypto: fix leak in ivgen essiv init

On error path, the 'salt' doesn't been freed thus leading
a memory leak. This patch avoid this.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Li Qiang 2017-01-03 20:31:34 -08:00 committed by Daniel P. Berrange
parent d992f2f136
commit 0072d2a9fc

View File

@ -48,6 +48,7 @@ static int qcrypto_ivgen_essiv_init(QCryptoIVGen *ivgen,
&salt, &nhash,
errp) < 0) {
g_free(essiv);
g_free(salt);
return -1;
}