Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteda3771

Browse files
committed
Fix for \g strdup error.
1 parent25fe3c7 commiteda3771

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/bin/psql/psql.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.31 1996/11/2204:43:48 bryanh Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.32 1996/11/2206:45:14 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1099,7 +1099,12 @@ HandleSlashCmds(PsqlSettings * settings,
10991099
break;
11001100
}
11011101
case'g':/* \g means send query */
1102-
settings->gfname=strdup(optarg);
1102+
if (!optarg)
1103+
settings->gfname=NULL;
1104+
elseif (!(settings->gfname=strdup(optarg))) {
1105+
perror("malloc");
1106+
exit(1);
1107+
}
11031108
status=0;
11041109
break;
11051110
case'h':/* help */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp