Potential memory leaks in ipa-getkeytab

This patch fixes 2 situations where a pointer to allocated error
string could be overwritten - which could have resulted in
a memory leak.

https://fedorahosted.org/freeipa/ticket/714
This commit is contained in:
Martin Kosek
2011-01-12 14:17:30 +01:00
committed by Simo Sorce
parent 063c6efd42
commit 7b5601eeb5

View File

@@ -245,6 +245,7 @@ static int prep_ksdata(krb5_context krbctx, const char *str,
&similar);
if (krberr) {
free_keys_contents(krbctx, keys);
free(ksdata);
fprintf(stderr, _("Enctype comparison failed!\n"));
return 0;
}
@@ -707,6 +708,7 @@ static int ldap_set_keytab(krb5_context krbctx,
ldap_controls_free(srvctrl);
ldap_msgfree(res);
ldap_unbind_ext(ld, NULL, NULL);
free(encs);
return kvno;
error_out: