From d1ca82d0a226f22438a1cf4ba0ed3460e6db692b Mon Sep 17 00:00:00 2001
From: Michael Meskes <meskes@postgresql.org>
Date: Fri, 10 Mar 2017 10:32:41 +0100
Subject: [PATCH] Fix a potential double-free in ecpg.

---
 src/interfaces/ecpg/preproc/pgc.l | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index 6b58dd5afe7..7b2bfdccc90 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -565,6 +565,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 				{
 					addlit(yytext, yyleng);
 					free(dolqstart);
+					dolqstart = NULL;
 					BEGIN(SQL);
 					base_yylval.str = mm_strdup(literalbuf);
 					return DOLCONST;
-- 
GitLab