mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Remove custom memory allocation layer in pgcrypto
PX_OWN_ALLOC was intended as a way to disable the use of palloc(), and
over the time new palloc() or equivalent calls have been added like in
32984d8
, making this extra layer losing its original purpose. This
simplifies on the way some code paths to use palloc0() rather than
palloc() followed by memset(0).
Author: Daniel Gustafsson
Discussion: https://postgr.es/m/A5BFAA1A-B2E8-4CBC-895E-7B1B9475A527@yesql.se
This commit is contained in:
@ -39,8 +39,7 @@ pgp_key_alloc(PGP_PubKey **pk_p)
|
||||
{
|
||||
PGP_PubKey *pk;
|
||||
|
||||
pk = px_alloc(sizeof(*pk));
|
||||
memset(pk, 0, sizeof(*pk));
|
||||
pk = palloc0(sizeof(*pk));
|
||||
*pk_p = pk;
|
||||
return 0;
|
||||
}
|
||||
@ -78,7 +77,7 @@ pgp_key_free(PGP_PubKey *pk)
|
||||
break;
|
||||
}
|
||||
px_memset(pk, 0, sizeof(*pk));
|
||||
px_free(pk);
|
||||
pfree(pk);
|
||||
}
|
||||
|
||||
static int
|
||||
|
Reference in New Issue
Block a user