bfd: Check NULL pointer before setting ref_real

PR ld/29086
	* linker.c (bfd_wrapped_link_hash_lookup): Check NULL pointer
	before setting ref_real.
This commit is contained in:
H.J. Lu
2022-05-04 17:00:15 -07:00
parent 4a947dc62f
commit 18e60f7c8a

View File

@ -599,7 +599,8 @@ bfd_wrapped_link_hash_lookup (bfd *abfd,
n[1] = '\0';
strcat (n, l + sizeof REAL - 1);
h = bfd_link_hash_lookup (info->hash, n, create, true, follow);
h->ref_real = 1;
if (h != NULL)
h->ref_real = 1;
free (n);
return h;
}