Skip to content

Commit

Permalink
Add call to confstr (_CS_PATH, dp, len); (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTodorovskiIBM authored Jan 26, 2024
1 parent 7d9c317 commit 600dfb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1476,9 +1476,10 @@ extern "C" int execvpe(const char *name, char *const argv[],
// If PATH is not defined, get the default from confstr
len = confstr(_CS_PATH, NULL, 0);
if (len) {
dp = (char*)malloc(len + 1);
dp = (char*)malloc(len);
if (dp == NULL)
return errno ? errno : ENOMEM;
confstr (_CS_PATH, dp, len);
} else
len = 1;
}
Expand Down

0 comments on commit 600dfb4

Please sign in to comment.