If profile_open_file() discovers a shared tree for the file, but
encounters an error when updating it, dereference the data and return
a null profile rather than returning an error and a newly broken file
object. Otherwise we'd leak the returned file object in
profile_init().
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25047
dc483132-0cff-0310-8789-
dd5450dbe970
(void) k5_mutex_unlock(&g_shared_trees_mutex);
retval = profile_update_file_data(data, NULL);
free(expanded_filename);
+ if (retval) {
+ profile_dereference_data(data);
+ free(prf);
+ return retval;
+ }
prf->data = data;
*ret_prof = prf;
scan_shared_trees_unlocked();
- return retval;
+ return 0;
}
(void) k5_mutex_unlock(&g_shared_trees_mutex);
data = profile_make_prf_data(expanded_filename);