* [patch] bfd: plug memory leak
@ 2007-06-28 21:42 msnyder
2007-06-28 21:59 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: msnyder @ 2007-06-28 21:42 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 22 bytes --]
Flagged by Coverity,
[-- Attachment #2: demangle --]
[-- Type: application/octet-stream, Size: 950 bytes --]
2007-06-28 Michael Snyder <msnyder@svkmacdonelllnx>
* bfd.c (bfd_demangle): Plug memory leak (Coverity).
Index: bfd.c
===================================================================
RCS file: /cvs/src/src/bfd/bfd.c,v
retrieving revision 1.94
diff -p -r1.94 bfd.c
*** bfd.c 27 Jun 2007 11:54:09 -0000 1.94
--- bfd.c 28 Jun 2007 21:10:30 -0000
*************** bfd_demangle (bfd *abfd, const char *nam
*** 1774,1780 ****
suf_len = strlen (suf) + 1;
final = bfd_malloc (pre_len + len + suf_len);
if (final == NULL)
! return NULL;
memcpy (final, pre, pre_len);
memcpy (final + pre_len, res, len);
--- 1774,1784 ----
suf_len = strlen (suf) + 1;
final = bfd_malloc (pre_len + len + suf_len);
if (final == NULL)
! {
! /* Free res before returning! */
! free (res);
! return NULL;
! }
memcpy (final, pre, pre_len);
memcpy (final + pre_len, res, len);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] bfd: plug memory leak
2007-06-28 21:42 [patch] bfd: plug memory leak msnyder
@ 2007-06-28 21:59 ` Daniel Jacobowitz
2007-06-28 22:17 ` msnyder
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-06-28 21:59 UTC (permalink / raw)
To: msnyder; +Cc: gdb-patches
On Thu, Jun 28, 2007 at 02:12:22PM -0700, msnyder@sonic.net wrote:
> Flagged by Coverity,
Could you use text attachments? It's awkward to reply to these.
BFD patches ought to go to the binutils list.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] bfd: plug memory leak
2007-06-28 21:59 ` Daniel Jacobowitz
@ 2007-06-28 22:17 ` msnyder
2007-06-28 22:43 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: msnyder @ 2007-06-28 22:17 UTC (permalink / raw)
To: msnyder, gdb-patches
> On Thu, Jun 28, 2007 at 02:12:22PM -0700, msnyder@sonic.net wrote:
>> Flagged by Coverity,
>
> Could you use text attachments? It's awkward to reply to these.
I'm trying to. What are you seeing?
> BFD patches ought to go to the binutils list.
Right, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] bfd: plug memory leak
2007-06-28 22:17 ` msnyder
@ 2007-06-28 22:43 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-06-28 22:43 UTC (permalink / raw)
To: msnyder; +Cc: gdb-patches
On Thu, Jun 28, 2007 at 03:15:16PM -0700, msnyder@sonic.net wrote:
> > On Thu, Jun 28, 2007 at 02:12:22PM -0700, msnyder@sonic.net wrote:
> >> Flagged by Coverity,
> >
> > Could you use text attachments? It's awkward to reply to these.
>
> I'm trying to. What are you seeing?
It looks sort of like this:
[-- Attachment #1 --]
[-- Type: text/plain, Encoding: 8bit, Size: 0.1K --]
Flagged by Coverity,
[-- Attachment #2: demangle --]
[-- Type: application/octet-stream, Encoding: base64, Size: 1.3K --]
[-- application/octet-stream is unsupported (use 'v' to view this part) --]
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-06-28 22:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-28 21:42 [patch] bfd: plug memory leak msnyder
2007-06-28 21:59 ` Daniel Jacobowitz
2007-06-28 22:17 ` msnyder
2007-06-28 22:43 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox