summaryrefslogtreecommitdiff
path: root/storage/maria/ma_crypt.c
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2016-02-02 19:54:18 +0200
committerMonty <monty@mariadb.org>2016-02-02 19:54:18 +0200
commit55ea26541d4c95e765073c70126d9bb490c572c6 (patch)
tree1735fbd3b218d1f8ecdcbf7d387592af3a247a25 /storage/maria/ma_crypt.c
parent11c2d3c3e21642107db625f33c177f09d8ccd3ca (diff)
downloadmariadb-git-55ea26541d4c95e765073c70126d9bb490c572c6.tar.gz
Fixed warnings and one memory loss found by valgrind
The memory loss could happen in Aria with encrypted tables when Aria failed to encrypt a block. In normal usage this should never happen.
Diffstat (limited to 'storage/maria/ma_crypt.c')
-rw-r--r--storage/maria/ma_crypt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/storage/maria/ma_crypt.c b/storage/maria/ma_crypt.c
index da82a1a37c8..cc605d79933 100644
--- a/storage/maria/ma_crypt.c
+++ b/storage/maria/ma_crypt.c
@@ -416,7 +416,10 @@ static my_bool ma_crypt_index_pre_write_hook(PAGECACHE_IO_HOOK_ARGS *args)
/* 2 - encrypt page */
if (ma_encrypt(share, share->crypt_data,
src + head, dst + head, size, pageno, lsn, &key_version))
+ {
+ my_free(crypt_buf);
return 1;
+ }
/* 3 - copy tail */
memcpy(dst + block_size - tail, src + block_size - tail, tail);
/* 4 - store key version */