Avoid double-free() bug.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 12 Nov 2013 13:49:50 +0000 (15:49 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 12 Nov 2013 13:49:50 +0000 (15:49 +0200)
Spotted by Fortify static analysis tool.

info.c

diff --git a/info.c b/info.c
index 63f382a436b7f394372349a113e82649d5a62d95..4483f15d499ec96cbb9654b4c916aebb02c196e5 100644 (file)
--- a/info.c
+++ b/info.c
@@ -4485,6 +4485,7 @@ PGAPI_ForeignKeys_old(
                }
                if (pkey_alloced)
                    free(pkey_text);
+               pkey_alloced = FALSE;
                /* Get to next primary key */
                for (k = 0; k < 2; k++)
                    pkey_ptr += strlen(pkey_ptr) + 1;