Skip to content

Commit 9bdf216

Browse files
committed
Fix memory leak for file name if expect file name contains a dot, per
report from dvice_null@yahoo.com.
1 parent b813c8d commit 9bdf216

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
return NULL;
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy