forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitac673a1
committed
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 anallocation for a set of DumpableObject items. The previous coding didan allocation of 1 byte instead as per the fallback of pg_malloc() inthe event of an allocation size of zero. This assigns NULL instead fora set of dumpable objects.A similar rule already applied to findObjectByOid(), so this makes thecode more defensive as we would just fail with a pointer dereferenceinstead of attempting to use some incorrect data if a non-existing,positive, OID is given by a caller of this function.Author: Daniel GustafssonReviewed-by: Julien Rouhaud, Ranier VilelaDiscussion:https://postgr.es/m/26C43E58-BDD0-4F1A-97CC-4A07B52E32C5@yesql.se1 parent19f5a37 commitac673a1
1 file changed
+3
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
719 | 719 |
| |
720 | 720 |
| |
721 | 721 |
| |
| 722 | + | |
| 723 | + | |
| 724 | + | |
722 | 725 |
| |
723 | 726 |
| |
724 | 727 |
| |
|
0 commit comments
Comments
(0)