Fix CID 11021: Resource leak

https://fedorahosted.org/freeipa/ticket/2037
This commit is contained in:
Simo Sorce
2011-11-07 11:13:55 -05:00
parent c286278aa9
commit c8aec450be
+3 -1
View File
@@ -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;
}