X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=plantuner.git;a=blobdiff_plain;f=plantuner.c;h=5a1d4809131a329e2e8a153644be2a27a9ee7768;hp=4e89d913b0f3f78a02876d3444a1f22420798e04;hb=e254f0c16b288a261d2ed1c7c6110223f359d3ff;hpb=ffe045ac1c8ecc2419b135168d620de1bc232268 diff --git a/plantuner.c b/plantuner.c index 4e89d91..5a1d480 100644 --- a/plantuner.c +++ b/plantuner.c @@ -40,6 +40,10 @@ #include #include #include +#if PG_VERSION_NUM >= 100000 +#include +#include +#endif PG_MODULE_MAGIC; @@ -118,12 +122,16 @@ indexesAssign(const char * newval, bool doit, GucSource source, bool isDisable) { if (isDisable) { - nDisabledIndexes = nOids; + nDisabledIndexes = i; + if (disabledIndexes) + free(disabledIndexes); disabledIndexes = newOids; } else { - nEnabledIndexes = nOids; + nEnabledIndexes = i; + if (enabledIndexes) + free(enabledIndexes); enabledIndexes = newOids; } }