summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@redhat.com>2014-02-07 16:46:23 -0600
committerAnand Avati <avati@redhat.com>2014-02-12 19:19:15 -0800
commitfbcae0d20a409bccd8fc4daeceac010fab66d0a0 (patch)
treef89ab6d684a50a3a2bbafe0c40549fe45d6235d7
parent1b88d86a660a5f4e007fb229d79c54666ce04ffb (diff)
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 <crh@redhat.com> Reviewed-on: http://review.gluster.org/6940 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--xlators/encryption/rot-13/src/rot-13.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/encryption/rot-13/src/rot-13.c b/xlators/encryption/rot-13/src/rot-13.c
index b9ac29a72e1..1bcfe0192f6 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;
}
}