mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-11-30 23:40:24 +00:00
* bfd.c (bfd_demangle): Plug memory leak (Coverity).
This commit is contained in:
parent
3d3d428f04
commit
32e8a950c4
@ -1,3 +1,7 @@
|
|||||||
|
2007-06-29 Michael Snyder <msnyder@svkmacdonelllnx>
|
||||||
|
|
||||||
|
* bfd.c (bfd_demangle): Plug memory leak (Coverity).
|
||||||
|
|
||||||
2007-06-29 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
|
2007-06-29 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
|
||||||
|
|
||||||
* Makefile.am: Add cr16 related entry
|
* Makefile.am: Add cr16 related entry
|
||||||
|
12
bfd/bfd.c
12
bfd/bfd.c
@ -1773,12 +1773,12 @@ bfd_demangle (bfd *abfd, const char *name, int options)
|
|||||||
suf = res + len;
|
suf = res + len;
|
||||||
suf_len = strlen (suf) + 1;
|
suf_len = strlen (suf) + 1;
|
||||||
final = bfd_malloc (pre_len + len + suf_len);
|
final = bfd_malloc (pre_len + len + suf_len);
|
||||||
if (final == NULL)
|
if (final != NULL)
|
||||||
return NULL;
|
{
|
||||||
|
memcpy (final, pre, pre_len);
|
||||||
memcpy (final, pre, pre_len);
|
memcpy (final + pre_len, res, len);
|
||||||
memcpy (final + pre_len, res, len);
|
memcpy (final + pre_len + len, suf, suf_len);
|
||||||
memcpy (final + pre_len + len, suf, suf_len);
|
}
|
||||||
free (res);
|
free (res);
|
||||||
res = final;
|
res = final;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user