diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2025-04-25 18:42:55 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2025-04-25 21:23:07 +0100 |
commit | adc6ca003a31e160ffb2dc39be535dbe26d7c2dc (patch) | |
tree | 5e0ff60c4737ed8924608be2e1df6f141766df63 | |
parent | 3a6e1f87e71a38ea8d49b9b12b81a4d2fe3fad89 (diff) | |
download | binutils-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.c | 2 |
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; } |