[3/4] libctf: fix a comment typo

Message ID 20230324133625.450723-3-nick.alcock@oracle.com
State Repeat Merge
Headers
Series [1/4] libctf: fix assertion failure with no system qsort_r |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Nick Alcock March 24, 2023, 1:36 p.m. UTC
  ctf_dedup's intern() function does not return a dynamically allocated
string, so I just spent ten minutes auditing for obvious memory leaks
that couldn't actually happen.  Update the comment to note what it
actually returns (a pointer into an atoms table: i.e. possibly not
a new string, and not so easily leakable).

libctf/
	* ctf-dedup.c (intern): Update comment.
---
 libctf/ctf-dedup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/libctf/ctf-dedup.c b/libctf/ctf-dedup.c
index 6297c45c84d..5fdddfd0b54 100644
--- a/libctf/ctf-dedup.c
+++ b/libctf/ctf-dedup.c
@@ -412,7 +412,7 @@  intern (ctf_dict_t *fp, char *atom)
 /* Add an indication of the namespace to a type name in a way that is not valid
    for C identifiers.  Used to maintain hashes of type names to other things
    while allowing for the four C namespaces (normal, struct, union, enum).
-   Return a new dynamically-allocated string.  */
+   Return a pointer into the cd_decorated_names atoms table.  */
 static const char *
 ctf_decorate_type_name (ctf_dict_t *fp, const char *name, int kind)
 {