From: Andreas Schwab Date: Thu, 26 Sep 2024 11:06:25 +0000 (+0200) Subject: Fix -Wstringop-overflow warning in ecoff_link_hash_newfunc X-Git-Tag: gdb-16-branchpoint~795 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d31c9cf54ace96819fd8dff16ea120c578d89a46;p=thirdparty%2Fbinutils-gdb.git Fix -Wstringop-overflow warning in ecoff_link_hash_newfunc * ecoff.c (ecoff_link_hash_newfunc): Don't call memset if ret is NULL. --- diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 04501761bd6..5ee7ffaf489 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -3278,8 +3278,8 @@ ecoff_link_hash_newfunc (struct bfd_hash_entry *entry, ret->abfd = NULL; ret->written = 0; ret->small = 0; + memset ((void *) &ret->esym, 0, sizeof ret->esym); } - memset ((void *) &ret->esym, 0, sizeof ret->esym); return (struct bfd_hash_entry *) ret; }