From adc6ca003a31e160ffb2dc39be535dbe26d7c2dc Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Fri, 25 Apr 2025 18:42:55 +0100 Subject: [PATCH] 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. --- libctf/ctf-dedup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.2