From c8aec450bef6cd24589476f7747bf37bf0e636ea Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 3 Nov 2011 13:40:46 -0400 Subject: Fix CID 11021: Resource leak https://fedorahosted.org/freeipa/ticket/2037 --- util/ipa_pwd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util') 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; } -- cgit