]> granicus.if.org Git - postgresql/commitdiff
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:40 +0000 (10:51 +0100)
src/interfaces/ecpg/preproc/pgc.l

index 5f876808050f767b69e7b8e60a760e11c27113ef..0dc98f79a85b0470b26b878937ce5a949b28d613 100644 (file)
@@ -559,6 +559,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;