Skip to content

Commit

Permalink
Use palloc_object instead of palloc
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov committed Mar 5, 2025
1 parent 282a3d8 commit 55c2c46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions percona_pg_telemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ get_database_list(void)

/* Switch to our memory context instead of the transaction one */
oldcxt = MemoryContextSwitchTo(pt_cxt);
dbinfo = (PTDatabaseInfo *) palloc(sizeof(PTDatabaseInfo));
dbinfo = palloc_object(PTDatabaseInfo);

/* Fill in the structure */
dbinfo->datid = pgdatabase->oid;
Expand Down Expand Up @@ -752,7 +752,7 @@ get_extensions_list(PTDatabaseInfo *dbinfo, MemoryContext cxt)

/* Switch to the given memory context */
oldcxt = MemoryContextSwitchTo(cxt);
extinfo = (PTExtensionInfo *) palloc(sizeof(PTExtensionInfo));
extinfo = palloc_object(PTExtensionInfo);

/* Fill in the structure */
extinfo->db_data = dbinfo;
Expand Down

0 comments on commit 55c2c46

Please sign in to comment.