diff options
author | Frederik Wedel-Heinen <frederik.wedel-heinen@dencrypt.dk> | 2024-12-22 13:35:00 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2025-01-03 15:58:26 +0100 |
commit | 65db21935a2add580eb35bdf0b0f37441549d54c (patch) | |
tree | 9ba407b52e9fd0713bf514bdd35011438566fd7a /demos | |
parent | test: allowedAttributeAssignments X.509v3 extension (diff) | |
download | openssl-65db21935a2add580eb35bdf0b0f37441549d54c.tar.xz openssl-65db21935a2add580eb35bdf0b0f37441549d54c.zip |
Avoid leaking memory when realloc fails
In ossl_property_merge() we can drop the realloc because it just makes
the allocation smaller.
In quic-hq-interop.c we check the realloc result.
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26244)
Diffstat (limited to 'demos')
-rw-r--r-- | demos/guide/quic-hq-interop.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/demos/guide/quic-hq-interop.c b/demos/guide/quic-hq-interop.c index deb6b633e9..7c158fc090 100644 --- a/demos/guide/quic-hq-interop.c +++ b/demos/guide/quic-hq-interop.c @@ -911,6 +911,8 @@ int main(int argc, char *argv[]) while (req != NULL) { total_requests++; req_array = OPENSSL_realloc(req_array, sizeof(char *) * total_requests); + if (req_array == NULL) + goto end; req_array[total_requests - 1] = req; req = strtok(NULL, " "); } |