AmendHub

Download:

jcs

/

wikipedia

/

amendments

/

40

focusable: Sync with upstream


jcs made amendment 40 10 months ago
--- focusable.c Wed Aug 31 16:19:53 2022 +++ focusable.c Wed Apr 5 12:07:03 2023 @@ -160,7 +160,9 @@ focusables_quit(void) * nfocusables and focusables array will probably be * modified as each focusable quits */ - tfocusables = xcalloc(sizeof(Ptr), tnfocusables, "tfocusables"); + tfocusables = xcalloc(sizeof(Ptr), tnfocusables); + if (tfocusables == NULL) + panic("Out of memory!"); memcpy(tfocusables, focusables, sizeof(Ptr) * tnfocusables); for (n = 0; n < tnfocusables; n++) { @@ -186,7 +188,9 @@ focusables_atexit(void) if (!nfocusables) return; - tfocusables = xcalloc(sizeof(Ptr), tnfocusables, "tfocusables"); + tfocusables = xcalloc(sizeof(Ptr), tnfocusables); + if (tfocusables == NULL) + panic("Out of memory!"); memcpy(tfocusables, focusables, sizeof(Ptr) * tnfocusables); for (n = 0; n < tnfocusables; n++) {