Skip to content

Commit

Permalink
crypto: fix leak in ivgen essiv init
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Qiang authored and berrange committed Feb 27, 2017
1 parent d992f2f commit 0072d2a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crypto/ivgen-essiv.c
Expand Up @@ -48,6 +48,7 @@ static int qcrypto_ivgen_essiv_init(QCryptoIVGen *ivgen,
&salt, &nhash,
errp) < 0) {
g_free(essiv);
g_free(salt);
return -1;
}

Expand Down

0 comments on commit 0072d2a

Please sign in to comment.