From fbcae0d20a409bccd8fc4daeceac010fab66d0a0 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Fri, 7 Feb 2014 16:46:23 -0600 Subject: xlators/rot-13: Free memory when returning on error. Added GF_FREE() calls to free allocated memory that was left behind otherwise. BUG: 789278 CID: 1124725 Change-Id: I5aa086d6b13a93e14de50e47e02b0e9813af9572 Signed-off-by: Christopher R. Hertel Reviewed-on: http://review.gluster.org/6940 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/encryption/rot-13/src/rot-13.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xlators') diff --git a/xlators/encryption/rot-13/src/rot-13.c b/xlators/encryption/rot-13/src/rot-13.c index b9ac29a72..1bcfe0192 100644 --- a/xlators/encryption/rot-13/src/rot-13.c +++ b/xlators/encryption/rot-13/src/rot-13.c @@ -150,6 +150,7 @@ init (xlator_t *this) if (gf_string2boolean (data->data, &priv->encrypt_write) == -1) { gf_log (this->name, GF_LOG_ERROR, "encrypt-write takes only boolean options"); + GF_FREE (priv); return -1; } } @@ -159,6 +160,7 @@ init (xlator_t *this) if (gf_string2boolean (data->data, &priv->decrypt_read) == -1) { gf_log (this->name, GF_LOG_ERROR, "decrypt-read takes only boolean options"); + GF_FREE (priv); return -1; } } -- cgit