Skip to content

Commit

Permalink
guard against stmpdir == NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
rschupp committed Aug 31, 2023
1 parent 3e363e5 commit dde3d83
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions myldr/mktmpdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,10 @@ static void par_rmtmpdir ( char *stmpdir ) {
#endif

void par_cleanup (char *stmpdir) {
char *dirname = par_dirname(stmpdir);
char *basename = par_basename(dirname);
char *dirname, *basename;
if ( par_env_clean() && stmpdir != NULL && strlen(stmpdir)) {
dirname = par_dirname(stmpdir);
basename = par_basename(dirname);
if ( strstr(basename, "par-") == basename ) {
par_rmtmpdir(stmpdir);
/* Don't try to remove dirname because this will introduce a race
Expand Down

0 comments on commit dde3d83

Please sign in to comment.