aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2025-04-25 18:42:55 +0100
committerNick Alcock <nick.alcock@oracle.com>2025-04-25 21:23:07 +0100
commitadc6ca003a31e160ffb2dc39be535dbe26d7c2dc (patch)
tree5e0ff60c4737ed8924608be2e1df6f141766df63
parent3a6e1f87e71a38ea8d49b9b12b81a4d2fe3fad89 (diff)
downloadbinutils-adc6ca003a31e160ffb2dc39be535dbe26d7c2dc.zip
binutils-adc6ca003a31e160ffb2dc39be535dbe26d7c2dc.tar.gz
binutils-adc6ca003a31e160ffb2dc39be535dbe26d7c2dc.tar.bz2
libctf: dedup: fix a broken error path in string dedup
If we run out of memory updating the string counts, set the right errno: ctf_dynhash_insert returns a *negative* error value, and we want a positive one in the ctf_errno.
-rw-r--r--libctf/ctf-dedup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libctf/ctf-dedup.c b/libctf/ctf-dedup.c
index 709bcfb..4566752 100644
--- a/libctf/ctf-dedup.c
+++ b/libctf/ctf-dedup.c
@@ -3229,7 +3229,7 @@ ctf_dedup_strings (ctf_dict_t *fp)
if ((err = ctf_dynhash_insert (str_counts, atom->csa_str, (void *) count)) < 0)
{
- ctf_set_errno (fp, err);
+ ctf_set_errno (fp, -err);
ctf_next_destroy (j);
goto err;
}