diff options
-rw-r--r-- | src/util/profile/prof_init.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index f0ff1370c..fbcbead12 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -34,8 +34,11 @@ profile_init(const_profile_filespec_t *files, profile_t *ret_profile) memset(profile, 0, sizeof(struct _profile_t)); profile->magic = PROF_MAGIC_PROFILE; - /* if the filenames list is not specified return an empty profile */ - if ( files ) { + /* + * If the filenames list is not specified or empty, return an empty + * profile. + */ + if ( files && !PROFILE_LAST_FILESPEC(*files) ) { for (fs = files; !PROFILE_LAST_FILESPEC(*fs); fs++) { retval = profile_open_file(*fs, &new_file); /* if this file is missing, skip to the next */ |