From 5ed6aba41c826194dcc97807392b22a3cefa1d7e Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 31 Mar 2003 18:13:25 +0000 Subject: Fix memory leaks --- bfd/linker.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'bfd/linker.c') diff --git a/bfd/linker.c b/bfd/linker.c index 918f4f8..c0e3236 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -1,23 +1,23 @@ /* linker.c -- BFD linker routines - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -2081,12 +2081,12 @@ _bfd_generic_final_link (abfd, info) input_section, relocs, symbols); + free (relocs); if (reloc_count < 0) return FALSE; BFD_ASSERT ((unsigned long) reloc_count == input_section->reloc_count); o->reloc_count += reloc_count; - free (relocs); } } if (o->reloc_count > 0) -- cgit v1.1