diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c
index 42b2911e4f2..7b68d709628 100644
--- a/libctf/ctf-link.c
+++ b/libctf/ctf-link.c
@@ -1221,7 +1221,7 @@ ctf_link_deduplicating_per_cu (ctf_dict_t *fp)
 							&parents)) == NULL)
 	{
 	  ctf_next_destroy (i);
-	  goto err_inputs;
+	  goto err_open_inputs;
 	}
 
       if ((out = ctf_create (&err)) == NULL)
