Обсуждение: rtree memory leak patch

Поиск
Список
Период
Сортировка

rtree memory leak patch

От
Kenneth Been
Дата:
Here is a patch for a memory leak in rtree.c, version 7.2.1 (in code
that I submitted last year, alas).

Ken

*** postgresql-7.2.1/src/backend/access/rtree/rtree.c.orig      Thu May
23 22:24:47 2002
--- postgresql-7.2.1/src/backend/access/rtree/rtree.c   Fri May 24
09:25:17 2002
***************
*** 931,936 ****
--- 931,938 ----

PointerGetDatum(&size_alpha));
                         FunctionCall2(&rtstate->sizeFn, union_dr,

PointerGetDatum(&size_beta));
+                       pfree(DatumGetPointer(union_dl));
+                       pfree(DatumGetPointer(union_dr));

                         diff = (size_alpha - size_l) - (size_beta -
size_r);



Re: rtree memory leak patch

От
Bruce Momjian
Дата:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Kenneth Been wrote:
> Here is a patch for a memory leak in rtree.c, version 7.2.1 (in code
> that I submitted last year, alas).
>
> Ken
>
> *** postgresql-7.2.1/src/backend/access/rtree/rtree.c.orig      Thu May
> 23 22:24:47 2002
> --- postgresql-7.2.1/src/backend/access/rtree/rtree.c   Fri May 24
> 09:25:17 2002
> ***************
> *** 931,936 ****
> --- 931,938 ----
>
> PointerGetDatum(&size_alpha));
>                          FunctionCall2(&rtstate->sizeFn, union_dr,
>
> PointerGetDatum(&size_beta));
> +                       pfree(DatumGetPointer(union_dl));
> +                       pfree(DatumGetPointer(union_dr));
>
>                          diff = (size_alpha - size_l) - (size_beta -
> size_r);
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



Re: rtree memory leak patch

От
Bruce Momjian
Дата:
Patch applied.  Thanks.

---------------------------------------------------------------------------



Kenneth Been wrote:
> Here is a patch for a memory leak in rtree.c, version 7.2.1 (in code
> that I submitted last year, alas).
>
> Ken
>
> *** postgresql-7.2.1/src/backend/access/rtree/rtree.c.orig      Thu May
> 23 22:24:47 2002
> --- postgresql-7.2.1/src/backend/access/rtree/rtree.c   Fri May 24
> 09:25:17 2002
> ***************
> *** 931,936 ****
> --- 931,938 ----
>
> PointerGetDatum(&size_alpha));
>                          FunctionCall2(&rtstate->sizeFn, union_dr,
>
> PointerGetDatum(&size_beta));
> +                       pfree(DatumGetPointer(union_dl));
> +                       pfree(DatumGetPointer(union_dr));
>
>                          diff = (size_alpha - size_l) - (size_beta -
> size_r);
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026