aboutsummaryrefslogtreecommitdiff
path: root/bfd/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/hash.c')
-rw-r--r--bfd/hash.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bfd/hash.c b/bfd/hash.c
index 14fc403..0f9fd7e 100644
--- a/bfd/hash.c
+++ b/bfd/hash.c
@@ -453,16 +453,17 @@ bfd_hash_lookup (struct bfd_hash_table *table,
if (copy)
{
- char *new;
+ char *new_string;
- new = objalloc_alloc ((struct objalloc *) table->memory, len + 1);
- if (!new)
+ new_string = (char *) objalloc_alloc ((struct objalloc *) table->memory,
+ len + 1);
+ if (!new_string)
{
bfd_set_error (bfd_error_no_memory);
return NULL;
}
- memcpy (new, string, len + 1);
- string = new;
+ memcpy (new_string, string, len + 1);
+ string = new_string;
}
return bfd_hash_insert (table, string, hash);