mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-29 22:49:41 +03:00 
			
		
		
		
	Protect from null param on ecpg disconnect, verified by Roland Karch
This commit is contained in:
		| @@ -1,4 +1,4 @@ | |||||||
| /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.204 2002/12/12 21:50:01 momjian Exp $ */ | /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.205 2002/12/13 20:29:07 momjian Exp $ */ | ||||||
|  |  | ||||||
| /* Copyright comment */ | /* Copyright comment */ | ||||||
| %{ | %{ | ||||||
| @@ -554,7 +554,8 @@ stmt:  AlterDatabaseSetStmt { output_statement($1, 0, connection); } | |||||||
| 			if (connection) | 			if (connection) | ||||||
| 				mmerror(PARSE_ERROR, ET_ERROR, "no at option for disconnect statement.\n"); | 				mmerror(PARSE_ERROR, ET_ERROR, "no at option for disconnect statement.\n"); | ||||||
|  |  | ||||||
| 			fprintf(yyout, "{ ECPGdisconnect(__LINE__, %s);", $1); | 			fprintf(yyout, "{ ECPGdisconnect(__LINE__, %s);", | ||||||
|  | 					$1 ? $1 : "\"CURRENT\""); | ||||||
| 			whenever_action(2); | 			whenever_action(2); | ||||||
| 			free($1); | 			free($1); | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user