Fixes
authorTeodor Sigaev <teodor@sigaev.ru>
Wed, 5 Sep 2018 14:25:58 +0000 (17:25 +0300)
committerTeodor Sigaev <teodor@sigaev.ru>
Wed, 5 Sep 2018 14:25:58 +0000 (17:25 +0300)
1) correct number of indexes if someone wasn't found in catalog
2) memory leak

plantuner.c

index 458236e..5a1d480 100644 (file)
@@ -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;
                }
        }