diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2021-12-06 10:50:56 +0100 |
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2021-12-06 10:50:56 +0100 |
| commit | c20d1e95b8be9db5bb9a5c3c74f5678b19147beb (patch) | |
| tree | d03a18d47c04474b59e103f30e2ab0f921a4429f | |
| parent | 3d9c289db42e09e47edcdb099b263f4113bb9a63 (diff) | |
| download | curl-bagder/multi-callback-errors.tar.gz | |
fixup multi to tighten a memory leak in OOM casesbagder/multi-callback-errors
| -rw-r--r-- | lib/multi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/multi.c b/lib/multi.c index eb593fce3..c34780f73 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -2841,8 +2841,10 @@ static CURLMcode singlesocket(struct Curl_multi *multi, /* add 'data' to the transfer hash on this socket! */ if(!Curl_hash_add(&entry->transfers, (char *)&data, /* hash key */ - sizeof(struct Curl_easy *), data)) + sizeof(struct Curl_easy *), data)) { + Curl_hash_destroy(&entry->transfers); return CURLM_OUT_OF_MEMORY; + } } comboaction = (entry->writers? CURL_POLL_OUT : 0) | |
