Git fork

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>

authored by

Aditya Garg and committed by
Junio C Hamano
ac4e02c5 44ba4b0b

+3 -1
+3 -1
imap-send.c
··· 905 905 response = cram(prompt, ctx->cfg->user, ctx->cfg->pass); 906 906 907 907 ret = socket_write(&ctx->imap->buf.sock, response, strlen(response)); 908 - if (ret != strlen(response)) 908 + if (ret != strlen(response)) { 909 + free(response); 909 910 return error("IMAP error: sending response failed"); 911 + } 910 912 911 913 free(response); 912 914