[pve-devel] [PATCH] add new pve2.3-vm stream

Dietmar Maurer dietmar at proxmox.com
Wed Jan 16 10:05:45 CET 2013


Your code introduces a memory leak, and does not share common code.

I committed a fixed version. Please can you test?

> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
>  data/src/status.c |   20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/data/src/status.c b/data/src/status.c index 304fcf4..f6e89b3
> 100644
> --- a/data/src/status.c
> +++ b/data/src/status.c
> @@ -942,6 +942,26 @@ update_rrd_data(
>  			create_rrd_file(filename, argcount, rrd_def_node);
>  		}
> 
> +	} else if (strncmp(key, "pve2.3-vm/", 10) == 0) {
> +		const char *vmid = key + 10;
> +
> +		skip = 3;
> +
> +		if (strchr(vmid, '/') != NULL)
> +			goto keyerror;
> +
> +		if (strlen(vmid) < 1)
> +			goto keyerror;
> +
> +		filename = g_strdup_printf(RRDDIR "/%s/%s", "pve2-vm",
> vmid);

this is the memory leak, because we lose the pointer to the already allocated filename.





More information about the pve-devel mailing list