From: Teodor Sigaev Date: Wed, 5 Sep 2018 14:25:58 +0000 (+0300) Subject: Fixes X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=e254f0c16b288a261d2ed1c7c6110223f359d3ff;p=plantuner.git Fixes 1) correct number of indexes if someone wasn't found in catalog 2) memory leak --- diff --git a/plantuner.c b/plantuner.c index 458236e..5a1d480 100644 --- a/plantuner.c +++ b/plantuner.c @@ -122,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; } }