From e9e0c8766bc7343b03ffd05abe08362cb6d755a9 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 14 Jan 2005 04:40:16 +0000 Subject: [PATCH] * prof_file.c (profile_open_file): If mutex creation fails, free storage directly instead of calling profile_close_file. ticket: 2878 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17035 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/profile/ChangeLog | 2 ++ src/util/profile/prof_file.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index 2247776e6..985664014 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -2,6 +2,8 @@ * prof_file.c (profile_free_file_data): Destroy mutex before freeing containing structure. + (profile_open_file): If mutex creation fails, free storage + directly instead of calling profile_close_file. 2004-12-14 Ken Raeburn diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c index dac4e8a1f..9b0048c9c 100644 --- a/src/util/profile/prof_file.c +++ b/src/util/profile/prof_file.c @@ -272,7 +272,8 @@ errcode_t profile_open_file(const_profile_filespec_t filespec, retval = k5_mutex_init(&data->lock); if (retval) { - profile_close_file(prf); + free(data); + free(prf); return retval; } -- 2.26.2