Fix a potential double-free in ecpg.
authorMichael Meskes <meskes@postgresql.org>
Fri, 10 Mar 2017 09:32:41 +0000 (10:32 +0100)
committerMichael Meskes <meskes@postgresql.org>
Fri, 10 Mar 2017 09:51:51 +0000 (10:51 +0100)
src/interfaces/ecpg/preproc/pgc.l

index 3aa63ae2c135e84bfe483f38a2dd4e6e8195d7c1..763b2de3e7efcabbb54b6f09309696928a6b76a9 100644 (file)
@@ -541,6 +541,7 @@ cppline         {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
                {
                    addlit(yytext, yyleng);
                    free(dolqstart);
+                   dolqstart = NULL;
                    BEGIN(SQL);
                    base_yylval.str = mm_strdup(literalbuf);
                    return DOLCONST;