diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-11-17 19:54:53 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-11-17 19:54:53 +0000 |
commit | eac07f1fd7dc278b69c8a6c62111f55d0c8475a3 (patch) | |
tree | d422c4d7f9774c2a4d4a040c468924b18b99a79d /src | |
parent | 42a8068b5ca8c27ef21dbfecebfd8bb0430139b1 (diff) |
Fix off-by-one memory allocation, as reported by Rod Taylor. Also
avoid repalloc'ing twice when once is sufficient.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libpq/hba.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 1f0b29896c0..c3c3d9c9bec 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.87.2.4 2003/04/13 04:07:31 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.87.2.5 2004/11/17 19:54:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -281,7 +281,7 @@ tokenize_inc_file(const char *inc_filename) { if (strlen(comma_str)) { - comma_str = repalloc(comma_str, strlen(comma_str) + 1); + comma_str = repalloc(comma_str, strlen(comma_str) + 1 + 1); strcat(comma_str, MULTI_VALUE_SEP); } comma_str = repalloc(comma_str, |