Re: [PATCH 1/2] imap-send: fix bug causing cfg->folder being set to NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Not sure about server_fill_credential(), but I think this is also
> a potential memory leak
> 
> static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
> {
> 	int ret;
> 	char *response;
> 
> 	response = cram(prompt, ctx->cfg->user, ctx->cfg->pass);
> 
> 	ret = socket_write(&ctx->imap->buf.sock, response, strlen(response));
> 	if (ret != strlen(response))
> +		free(response); // fix for the leak
> 		return error("IMAP error: sending response failed");
> 
> 	free(response);
> 
> 	return 0;
> }


So this change leads to:

  imap-send.c:990:2: error: code will never be executed [-Werror,-Wunreachable-code]
          free(response);
          ^~~~

I think it's better to leave the other leaks for a different series. You might want to
treat it as a bug report as well.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux