mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
imap-send: fix memory leak in case auth_cram_md5 fails
This patch fixes a memory leak by running free(response) in case auth_cram_md5 fails. Signed-off-by: Aditya Garg <gargaditya08@live.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
44ba4b0bbb
commit
ac4e02c503
@@ -905,8 +905,10 @@ static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
|
||||
response = cram(prompt, ctx->cfg->user, ctx->cfg->pass);
|
||||
|
||||
ret = socket_write(&ctx->imap->buf.sock, response, strlen(response));
|
||||
if (ret != strlen(response))
|
||||
if (ret != strlen(response)) {
|
||||
free(response);
|
||||
return error("IMAP error: sending response failed");
|
||||
}
|
||||
|
||||
free(response);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user