diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-08-23 16:25:40 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-08-25 18:30:10 -0700 |
commit | 97067349a8d75ab720ff2e98653a6b21f60b221e (patch) | |
tree | 6417c39de7dbee474e2129ffe60f6883fae47a79 /lwlib | |
parent | 5b5896132f292986e89913b650d21c0b16896298 (diff) | |
download | emacs-97067349a8d75ab720ff2e98653a6b21f60b221e.tar.gz |
Fix unlikely core dump with Xaw
* lwlib/lwlib-Xaw.c (make_dialog): Don’t dump core if calloc fails.
Caught with --enable-gcc-warnings.
Diffstat (limited to 'lwlib')
-rw-r--r-- | lwlib/lwlib-Xaw.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c index d17acae728b..b09795ec38c 100644 --- a/lwlib/lwlib-Xaw.c +++ b/lwlib/lwlib-Xaw.c @@ -594,6 +594,8 @@ make_dialog (char* name, int nr_xft_data = left_buttons + right_buttons + 1; instance->xft_data = calloc (nr_xft_data + 1, sizeof(*instance->xft_data)); + if (!instance->xft_data) + memory_full ((nr_xft_data + 1) * sizeof *instance->xft_data); fill_xft_data (&instance->xft_data[0], w, xft_font); XtAddCallback (dialog, XtNdestroyCallback, destroy_xft_data, |