svn rev #21926: trunk/src/lib/krb5/krb/
raeburn@MIT.EDU
raeburn at MIT.EDU
Mon Feb 9 15:39:56 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=21926
Commit By: raeburn
Log Message:
ticket: 6377
Fix one more case of an explicit null check before calling a free
function that does the null check.
Also, use krb5_free_keyblock_contents instead of open-coding all the
work (and not trying hard enough to clear the memory).
Changed Files:
U trunk/src/lib/krb5/krb/kfree.c
Modified: trunk/src/lib/krb5/krb/kfree.c
===================================================================
--- trunk/src/lib/krb5/krb/kfree.c 2009-02-09 19:07:09 UTC (rev 21925)
+++ trunk/src/lib/krb5/krb/kfree.c 2009-02-09 20:39:54 UTC (rev 21926)
@@ -60,8 +60,7 @@
{
if (val == NULL)
return;
- if (val->contents)
- free(val->contents);
+ free(val->contents);
free(val);
}
@@ -188,11 +187,7 @@
val->client = 0;
krb5_free_principal(context, val->server);
val->server = 0;
- if (val->keyblock.contents) {
- memset(val->keyblock.contents, 0, val->keyblock.length);
- free(val->keyblock.contents);
- val->keyblock.contents = 0;
- }
+ krb5_free_keyblock_contents(context, &val->keyblock);
free(val->ticket.data);
val->ticket.data = 0;
free(val->second_ticket.data);
More information about the cvs-krb5
mailing list