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

Commit9bdf216

Browse files
committed
Fix memory leak for file name if expect file name contains a dot, per
report from dvice_null@yahoo.com.
1 parentb813c8d commit9bdf216

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/test/regress/pg_regress.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.56 2009/01/01 17:24:04 momjian Exp $
14+
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.57 2009/01/08 20:09:06 momjian Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -1134,7 +1134,11 @@ get_alternative_expectfile(const char *expectfile, int i)
11341134
strcpy(tmp,expectfile);
11351135
last_dot=strrchr(tmp,'.');
11361136
if (!last_dot)
1137+
{
1138+
free(tmp);
1139+
free(s);
11371140
returnNULL;
1141+
}
11381142
*last_dot='\0';
11391143
snprintf(s,ssize,"%s_%d.%s",tmp,i,last_dot+1);
11401144
free(tmp);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp