From 9a8dbb4c8c3d1af6168fb37b23efee1146242e8c Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 14 Aug 2008 04:55:14 +0000 Subject: [PATCH] krb5_fcc_read_addrs returns pointer to released memory on malloc failre In cleanup code on malloc failure, addresses are released including pointer to the krb5_address * - but the freed value is returned to caller. Clear pointer. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20654 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/cc_file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/krb5/ccache/cc_file.c b/src/lib/krb5/ccache/cc_file.c index 0fe099c45..f69d4929c 100644 --- a/src/lib/krb5/ccache/cc_file.c +++ b/src/lib/krb5/ccache/cc_file.c @@ -539,6 +539,7 @@ krb5_fcc_read_addrs(krb5_context context, krb5_ccache id, krb5_address ***addrs) (*addrs)[i] = (krb5_address *) malloc(sizeof(krb5_address)); if ((*addrs)[i] == NULL) { krb5_free_addresses(context, *addrs); + *addrs = 0; return KRB5_CC_NOMEM; } (*addrs)[i]->contents = NULL; -- 2.26.2