[collectd] [PATCH] src/csv.c: use a bigger buffer

Florian Forster octo at collectd.org
Wed Jul 27 13:37:38 CEST 2011


Hi Colin,

thank you very much for your patch!

On Mon, Jul 25, 2011 at 05:00:07PM -0700, Colin McCabe wrote:
> -	char         values[512];
> +	char         *values = NULL;

Why don't use stick with stack memory here? Allocating a (fixed sized)
junk on the heap only means that you'll have to free it again.

> -		return (-1);
> +		goto fail;

Sorry, but "goto" is a no-go for collectd. You can use something like
"do { … } while (0);" if you must, but in this particular case I think
simply using stack memory is the way to go.

Best regards,
—octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x0C705A15
http://octo.it/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20110727/bd2e4cf6/attachment.pgp>


More information about the collectd mailing list