aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-10-07 17:29:12 +0000
committerBruce Momjian <bruce@momjian.us>2004-10-07 17:29:12 +0000
commit6d46ea25f2131b34c1983a171e45041ba93390e0 (patch)
tree404a012ddb7ecf6feae2d03a179e3851c297cd58 /src
parent9fb5c757b880fa51443e6ded6d0a590ab1864b84 (diff)
downloadpostgresql-6d46ea25f2131b34c1983a171e45041ba93390e0.tar.gz
postgresql-6d46ea25f2131b34c1983a171e45041ba93390e0.zip
Add one more byte to malloc for null storage.
Diffstat (limited to 'src')
-rw-r--r--src/bin/initdb/initdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index f2a110e9d9a..9d80ff2ef1b 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.57 2004/10/07 16:53:25 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.58 2004/10/07 17:29:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1909,7 +1909,7 @@ escape_locale(char **locale)
{
int len = strlen(*locale),
i, j;
- char *loc_temp = xmalloc(len * 2);
+ char *loc_temp = xmalloc(len * 2 + 1);
for (i = 0, j = 0; i < len; i++)
{