diff options
author | Nick Clifton <nickc@redhat.com> | 2011-03-25 17:22:15 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2011-03-25 17:22:15 +0000 |
commit | cd37dafcf4bc4c4dce9854529523aa1c3221f849 (patch) | |
tree | c7ee423ceaf2a9813e68b496a6b67653c1f0e394 | |
parent | 8e4850a9e39ff6541d7e705710540191f7e23dc8 (diff) | |
download | gdb-cd37dafcf4bc4c4dce9854529523aa1c3221f849.zip gdb-cd37dafcf4bc4c4dce9854529523aa1c3221f849.tar.gz gdb-cd37dafcf4bc4c4dce9854529523aa1c3221f849.tar.bz2 |
* ieee.c (ieee_add_bb11): Plug memory leak.
(ieee_function_type): Likewise.
(ieee_class_baseclass): Likewise.
-rw-r--r-- | binutils/ChangeLog | 3 | ||||
-rw-r--r-- | binutils/ieee.c | 22 |
2 files changed, 20 insertions, 5 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 99e5ed7..d6ee055 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -4,6 +4,9 @@ * ar.c (move_members): Plug memory leak. (delete_members): Plug memory leak. (write_archive): Plug memory leak. + * ieee.c (ieee_add_bb11): Plug memory leak. + (ieee_function_type): Likewise. + (ieee_class_baseclass): Likewise. 2011-03-25 Pierre Muller <muller@ics.u-strasbg.fr> diff --git a/binutils/ieee.c b/binutils/ieee.c index c8460dc..044da31 100644 --- a/binutils/ieee.c +++ b/binutils/ieee.c @@ -1,6 +1,6 @@ /* ieee.c -- Read and write IEEE-695 debugging information. Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, - 2008, 2009, 2010 Free Software Foundation, Inc. + 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com>. This file is part of GNU Binutils. @@ -5125,7 +5125,10 @@ ieee_add_bb11 (struct ieee_handle *info, asection *sec, bfd_vma low, || ! ieee_write_id (info, "") || ! ieee_write_number (info, 0) || ! ieee_write_id (info, "GNU objcopy")) - return FALSE; + { + free (c); + return FALSE; + } free (c); } @@ -5529,7 +5532,10 @@ ieee_function_type (void *p, int argcount, bfd_boolean varargs) || ! ieee_write_number (info, 0) || ! ieee_write_number (info, retindx) || ! ieee_write_number (info, (bfd_vma) argcount + (varargs ? 1 : 0))) - return FALSE; + { + free (args); + return FALSE; + } if (argcount > 0) { for (i = 0; i < argcount; i++) @@ -6235,7 +6241,10 @@ ieee_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean is_virtual, || ! ieee_write_id (info, fname) || ! ieee_write_number (info, bindx) || ! ieee_write_number (info, bitpos / 8)) - return FALSE; + { + free (fname); + return FALSE; + } flags = 0; } @@ -6250,7 +6259,10 @@ ieee_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean is_virtual, || ! ieee_write_atn65 (info, nindx, bname) || ! ieee_write_asn (info, nindx, 0) || ! ieee_write_atn65 (info, nindx, fname)) - return FALSE; + { + free (fname); + return FALSE; + } info->type_stack->type.classdef->pmisccount += 5; free (fname); |