summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2011-11-03 13:40:46 -0400
committerSimo Sorce <ssorce@redhat.com>2011-11-07 11:13:55 -0500
commitc8aec450bef6cd24589476f7747bf37bf0e636ea (patch)
tree2b054395f4022f195f229834cec7f963f7611bea /util
parentc286278aa94091460a1f6ce243c16ba649f45363 (diff)
downloadfreeipa-c8aec450bef6cd24589476f7747bf37bf0e636ea.tar.gz
freeipa-c8aec450bef6cd24589476f7747bf37bf0e636ea.tar.xz
freeipa-c8aec450bef6cd24589476f7747bf37bf0e636ea.zip
Fix CID 11021: Resource leak
https://fedorahosted.org/freeipa/ticket/2037
Diffstat (limited to 'util')
-rw-r--r--util/ipa_pwd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/ipa_pwd.c b/util/ipa_pwd.c
index c41617533..fda6cb34e 100644
--- a/util/ipa_pwd.c
+++ b/util/ipa_pwd.c
@@ -560,7 +560,7 @@ int ipapwd_generate_new_history(char *password,
unsigned char *hash = NULL;
unsigned int hash_len;
char *new_element;
- char **ordered;
+ char **ordered = NULL;
int c, i, n;
int len;
int ret;
@@ -626,9 +626,11 @@ int ipapwd_generate_new_history(char *password,
*new_pwd_history = ordered;
*new_pwd_hlen = n;
+ ordered = NULL;
ret = IPAPWD_POLICY_OK;
done:
+ free(ordered);
free(hash);
return ret;
}