* prof_file.c (profile_open_file): If mutex creation fails, free storage
authorKen Raeburn <raeburn@mit.edu>
Fri, 14 Jan 2005 04:40:16 +0000 (04:40 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 14 Jan 2005 04:40:16 +0000 (04:40 +0000)
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
src/util/profile/prof_file.c

index 2247776e6db1b1b4fb74eb5d02415074684ec4d3..985664014dcc36964126a76c4755d6784c4f91e5 100644 (file)
@@ -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  <raeburn@mit.edu>
 
index dac4e8a1f9660b4328e3a3bf8b866e1a2595b09e..9b0048c9cbb18f2f8709e067644164a3db114652 100644 (file)
@@ -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;
        }