diff options
author | David Rowley <drowley@postgresql.org> | 2024-07-29 09:53:10 +1200 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2024-07-29 09:53:10 +1200 |
commit | da87dc07f16e7435edc601661a6ec71b38bccd25 (patch) | |
tree | be5e29f7a980fe4f58f474d012ce68289e3ab799 /src/backend | |
parent | c0ef1234dfb68bb0b5c926c0eafd82881ad78374 (diff) | |
download | postgresql-da87dc07f16e7435edc601661a6ec71b38bccd25.tar.gz postgresql-da87dc07f16e7435edc601661a6ec71b38bccd25.zip |
Add missing pointer dereference in pg_backend_memory_contexts view
32d3ed816 moved the logic for setting the context's name and ident into
a reusable function. I missed adding a pointer dereference after
copying and pasting the code into that function. The ident parameter is
a pointer to the ident variable in the calling function, so the
dereference is required to correctly determine if the contents of that
variable is NULL or not.
In passing, adjust the if condition to include an == NULL to make it
more clear that it's not checking for == '\0'.
Reported-by: Tom Lane, Coverity
Discussion: https://postgr.es/m/2256588.1722184287@sss.pgh.pa.us
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/utils/adt/mcxtfuncs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/mcxtfuncs.c b/src/backend/utils/adt/mcxtfuncs.c index 199e68c1ae5..5905958c1f5 100644 --- a/src/backend/utils/adt/mcxtfuncs.c +++ b/src/backend/utils/adt/mcxtfuncs.c @@ -55,7 +55,7 @@ get_memory_context_name_and_ident(MemoryContext context, const char **const name * To be consistent with logging output, we label dynahash contexts with * just the hash table name as with MemoryContextStatsPrint(). */ - if (ident && strcmp(*name, "dynahash") == 0) + if (*ident == NULL && strcmp(*name, "dynahash") == 0) { *name = *ident; *ident = NULL; |