[rrd-developers] Some memory leaks
Tobias Oetiker
tobi at oetiker.ch
Mon Oct 25 07:45:35 CEST 2010
Hi Christian,
makes sense ... thanks ... added.
cheers
tobi
Oct 17 Christian Magnusson wrote:
> Hi all,
>
> I tried to use librrd and update a remote rrd-database.
> When rrdcached isn't started, librrd leak some memory.
>
> Patch follows below...
>
> /Christian
>
>
> diff -ruw rrdtool-1.4.4.org/src/rrd_client.c
> rrdtool-1.4.4/src/rrd_client.c
> --- rrdtool-1.4.4.org/src/rrd_client.c 2010-06-30 14:48:47.000000000
> +0200
> +++ rrdtool-1.4.4/src/rrd_client.c 2010-10-13 08:58:46.000000000 +0200
> @@ -504,6 +504,8 @@
> break;
> } /* for (ai_ptr) */
>
> + freeaddrinfo(ai_res);
> +
> return (status);
> } /* }}} int rrdc_connect_network */
>
> diff -ruw rrdtool-1.4.4.org/src/rrd_update.c
> rrdtool-1.4.4/src/rrd_update.c
> --- rrdtool-1.4.4.org/src/rrd_update.c 2010-07-05 17:38:22.000000000
> +0200
> +++ rrdtool-1.4.4/src/rrd_update.c 2010-10-13 08:49:24.000000000 +0200
> @@ -429,7 +429,10 @@
>
> { /* try to connect to rrdcached */
> int status = rrdc_connect(opt_daemon);
> - if (status != 0) return status;
> + if (status != 0) {
> + rc = status;
> + goto out;
> + }
> }
>
> if ((tmplt != NULL) && rrdc_is_connected(opt_daemon))
>
>
>
>
>
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900
More information about the rrd-developers
mailing list