-fix theoretical use-after-free in test on error path

This commit is contained in:
Christian Grothoff
2023-09-25 21:52:48 +02:00
parent 64d90a1a85
commit 4a031e5482
+3 -2
View File
@@ -114,7 +114,8 @@
#define mhdErrorExit(ignore) _mhdErrorExit_func (NULL, NULL, __LINE__)
#define mhdErrorExitDesc(errDesc) _mhdErrorExit_func (errDesc, NULL, __LINE__)
#define checkCURLE_OK(libcurlcall) \
_checkCURLE_OK_func((libcurlcall), _MHD_STRMACRO(libcurlcall), NULL, __LINE__)
_checkCURLE_OK_func ((libcurlcall), _MHD_STRMACRO (libcurlcall), NULL, \
__LINE__)
#endif
@@ -388,7 +389,6 @@ ahc_echo (void *cls,
mhdErrorExitDesc ("'userhash_hex' is NOT zero");
else if (NULL != creds->userhash_bin)
mhdErrorExitDesc ("'userhash_bin' is NOT NULL");
MHD_free (creds);
dinfo = MHD_digest_auth_get_request_info3 (connection);
if (NULL == dinfo)
@@ -488,6 +488,7 @@ ahc_echo (void *cls,
dinfo->realm);
mhdErrorExitDesc ("Wrong 'realm'");
}
MHD_free (creds);
MHD_free (dinfo);
check_res = MHD_digest_auth_check3 (connection, REALM, USERNAME,