Skip to content

Commit

Permalink
Add comment about calloc failure (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Sep 12, 2024
1 parent d254d94 commit a9fe1da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions mosaic-terminal/src/c/mosaic-rawMode-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ rawModeResult enterRawMode() {

struct termios *saved = calloc(1, sizeof(struct termios));
if (unlikely(saved == NULL)) {
// result.saved is set to 0 which will trigger OOM.
goto ret;
}

Expand Down
1 change: 1 addition & 0 deletions mosaic-terminal/src/c/mosaic-rawMode-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ rawModeResult enterRawMode() {

rawModeConfigWindows *saved = malloc(sizeof(rawModeConfigWindows));
if (unlikely(saved == NULL)) {
// result.saved is set to 0 which will trigger OOM.
goto ret;
}

Expand Down

0 comments on commit a9fe1da

Please sign in to comment.