Skip to content

Commit

Permalink
kthd: typo in exec()
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Oct 1, 2024
1 parent 400fa58 commit f99a94c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kthd/src/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ void kthdExec(ExecCommand *cmd) {

// now read the file into memory
// allocate a new buffer for this
ExecCommand *res = calloc(1, sizeof(ExecCommand) + st.st_size);
size_t size = st.st_size + sizeof(ExecCommand);
ExecCommand *res = calloc(2, size);
if(!res) {
close(fd);
cmd->header.header.status = -ENOMEM;
Expand Down

0 comments on commit f99a94c

Please sign in to comment.