Page 1 of 1

Re: [Nagios-devel] xodtemplate.c malloc question

Posted: Wed Dec 17, 2008 2:54 pm
by Guest
hiren wrote:
> just something I thought was odd, is the following diff valid?
> thanks.
>

It's a valid diff, but the patch is entirely moot. A pointer to a
pointer is exactly the same size as a pointer to anything else.
As such, this is just code churn that changes exactly nothing.

>
> --- xdata/xodtemplate.c 2008-11-30 19:22:59.000000000 +0200
> +++ /tmp/xodtemplate.c 2008-12-15 16:45:58.000000000 +0200
> @@ -175,7 +175,7 @@
>
> /* allocate memory for 256 config files (increased dynamically) */
> xodtemplate_current_config_file=0;
> - xodtemplate_config_files=(char **)malloc(256*sizeof(char **));
> + xodtemplate_config_files=(char *)malloc(256*sizeof(char *));
> if(xodtemplate_config_files==NULL)
> return ERROR;
>

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]