Re: [PATCH] Fix memory leak in function handle_content_type

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

 



Jinyao Guo <guo846@xxxxxxxxxx> writes:

> @@ -266,6 +266,9 @@ static void handle_content_type(struct mailinfo *mi, struct strbuf *line)
>  			error("Too many boundaries to handle");
>  			mi->input_error = -1;
>  			mi->content_top = &mi->content[MAX_BOUNDARIES] - 1;
> +			strbuf_release(boundary);
> +			free(boundary);
> +			boundary = NULL;
>  			return;
>  		}
>  		*(mi->content_top) = boundary;

"boundary" is a on-stack local variable.  There is no need to assign
NULL to it immediately before you return.  In the post-context of
this hunk, we free it but leave the variable pointing at a random
place after that before returning.







[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