From: Paul Eggert Date: Tue, 23 Aug 2022 23:25:40 +0000 (-0700) Subject: Fix unlikely core dump with Xaw X-Git-Tag: emacs-29.0.90~1893^2~31 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=97067349a8d75ab720ff2e98653a6b21f60b221e;p=emacs.git Fix unlikely core dump with Xaw * lwlib/lwlib-Xaw.c (make_dialog): Don’t dump core if calloc fails. Caught with --enable-gcc-warnings. --- 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,