From 1a073a20db78bb0d0250bda27def4f03ac2b6001 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 22 Aug 2014 21:40:05 +0200 Subject: [PATCH] sasl: Fixed a memory leak on OOM --- lib/curl_sasl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index 8f6aab2e8..7e2b8afaf 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -569,6 +569,7 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, "qop=%s", userp, realm, nonce, cnonce, nonceCount, spn, resp_hash_hex, qop); + Curl_safefree(spn); if(!response) return CURLE_OUT_OF_MEMORY; @@ -576,7 +577,6 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, result = Curl_base64_encode(data, response, 0, outptr, outlen); Curl_safefree(response); - Curl_safefree(spn); return result; }