libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 39813f4f284c69a7133889e1f295fe422b5bf31a
parent 6b3d0c27b79ef0622ce1b0147bdaeabee97ff59e
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 27 Feb 2021 21:04:09 +0100

fix leak

Diffstat:
Msrc/testcurl/test_get_iovec.c | 13++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/testcurl/test_get_iovec.c b/src/testcurl/test_get_iovec.c @@ -95,14 +95,11 @@ iov_free_callback (void *cls) static void iovncont_free_callback (void *cls) { - struct MHD_IoVec *iov = (struct MHD_IoVec *) cls; - int i; + struct MHD_IoVec *iov = cls; + unsigned int i; for (i = 0; i < TESTSTR_IOVCNT; ++i) - { free (iov[i].iov_base); - } - free (iov); } @@ -236,7 +233,9 @@ ncont_echo (void *cls, TESTSTR_IOVCNT, &iovncont_free_callback, iov); - ret = MHD_queue_response (connection, MHD_HTTP_OK, response); + ret = MHD_queue_response (connection, + MHD_HTTP_OK, + response); MHD_destroy_response (response); if (ret == MHD_NO) abort (); @@ -248,7 +247,7 @@ err_out: if (NULL != iov[j].iov_base) free (iov[j].iov_base); } - + free (iov); return MHD_NO; }