diff options
Diffstat (limited to 'src/bin/pg_basebackup/streamutil.c')
-rw-r--r-- | src/bin/pg_basebackup/streamutil.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c index c32c5acb2b9..e5fd6fd7655 100644 --- a/src/bin/pg_basebackup/streamutil.c +++ b/src/bin/pg_basebackup/streamutil.c @@ -54,6 +54,9 @@ xmalloc0(int size) { void *result; + /* Avoid unportable behavior of malloc(0) */ + if (size == 0) + size = 1; result = malloc(size); if (!result) { |