libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit e8ffa59cd884e3d83887fe9ec7edaddb25303cb6
parent 87ca3176868ee8f3ee2a4632a656087bb9bc0d8b
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Wed, 26 Aug 2026 09:57:18 +0200

test_oom: fixed unchecked use of malloc() result

Diffstat:
Msrc/tests/raw/test_oom.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/tests/raw/test_oom.c b/src/tests/raw/test_oom.c @@ -172,6 +172,12 @@ upload_cb (void *upload_cls, (void)content_data_size; (void)content_data; flag = malloc (sizeof (int)); + if (NULL == flag) + { + fprintf (stderr, + "Failed to allocate memory.\n"); + exit (99); + } *flag = 1; return MHD_upload_action_from_response (