diff options
author | Michael Paquier | 2020-09-14 01:44:23 +0000 |
---|---|---|
committer | Michael Paquier | 2020-09-14 01:44:23 +0000 |
commit | ac673a1aaff197f3e01f7bac69da0dd700854e13 (patch) | |
tree | c623910b03cf1368683838724a5247f123778636 /src/bin/pg_verifybackup/pg_verifybackup.c | |
parent | 19f5a37b9fc48a12c77edafb732543875da2f4a3 (diff) |
Avoid useless allocations for information of dumpable objects in pg_dump/
If there are no objects of a certain type, there is no need to do an
allocation for a set of DumpableObject items. The previous coding did
an allocation of 1 byte instead as per the fallback of pg_malloc() in
the event of an allocation size of zero. This assigns NULL instead for
a set of dumpable objects.
A similar rule already applied to findObjectByOid(), so this makes the
code more defensive as we would just fail with a pointer dereference
instead of attempting to use some incorrect data if a non-existing,
positive, OID is given by a caller of this function.
Author: Daniel Gustafsson
Reviewed-by: Julien Rouhaud, Ranier Vilela
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/bin/pg_verifybackup/pg_verifybackup.c')
0 files changed, 0 insertions, 0 deletions