From: Nick Alcock Date: Fri, 25 Apr 2025 17:42:55 +0000 (+0100) Subject: libctf: dedup: fix a broken error path in string dedup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adc6ca003a31e160ffb2dc39be535dbe26d7c2dc;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/libctf/ctf-dedup.c b/libctf/ctf-dedup.c index 709bcfb04f5..45667525291 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; }