mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-23 13:21:43 +08:00
PR binutils/12720
Revert the following change Michael Snyder <msnyder@vmware.com> * ar.c (move_members): Plug memory leak. (delete_members): Plug memory leak.
This commit is contained in:
parent
f33edef842
commit
4510857d06
@ -1,3 +1,11 @@
|
|||||||
|
2011-05-02 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR binutils/12720
|
||||||
|
Revert the following change
|
||||||
|
Michael Snyder <msnyder@vmware.com>
|
||||||
|
* ar.c (move_members): Plug memory leak.
|
||||||
|
(delete_members): Plug memory leak.
|
||||||
|
|
||||||
2011-04-28 Tom Tromey <tromey@redhat.com>
|
2011-04-28 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* NEWS: Add note about --dwarf-depth, --dwarf-start, and
|
* NEWS: Add note about --dwarf-depth, --dwarf-start, and
|
||||||
|
@ -1119,7 +1119,6 @@ delete_members (bfd *arch, char **files_to_delete)
|
|||||||
bfd_boolean found;
|
bfd_boolean found;
|
||||||
bfd_boolean something_changed = FALSE;
|
bfd_boolean something_changed = FALSE;
|
||||||
int match_count;
|
int match_count;
|
||||||
const char * tmp = NULL;
|
|
||||||
|
|
||||||
for (; *files_to_delete != NULL; ++files_to_delete)
|
for (; *files_to_delete != NULL; ++files_to_delete)
|
||||||
{
|
{
|
||||||
@ -1141,10 +1140,8 @@ delete_members (bfd *arch, char **files_to_delete)
|
|||||||
current_ptr_ptr = &(arch->archive_next);
|
current_ptr_ptr = &(arch->archive_next);
|
||||||
while (*current_ptr_ptr)
|
while (*current_ptr_ptr)
|
||||||
{
|
{
|
||||||
if (tmp != NULL)
|
if (FILENAME_CMP (normalize (*files_to_delete, arch),
|
||||||
free ((char *) tmp);
|
(*current_ptr_ptr)->filename) == 0)
|
||||||
tmp = normalize (*files_to_delete, arch);
|
|
||||||
if (FILENAME_CMP (tmp, (*current_ptr_ptr)->filename) == 0)
|
|
||||||
{
|
{
|
||||||
++match_count;
|
++match_count;
|
||||||
if (counted_name_mode
|
if (counted_name_mode
|
||||||
@ -1181,9 +1178,6 @@ delete_members (bfd *arch, char **files_to_delete)
|
|||||||
write_archive (arch);
|
write_archive (arch);
|
||||||
else
|
else
|
||||||
output_filename = NULL;
|
output_filename = NULL;
|
||||||
|
|
||||||
if (tmp != NULL)
|
|
||||||
free ((char *) tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1192,9 +1186,8 @@ delete_members (bfd *arch, char **files_to_delete)
|
|||||||
static void
|
static void
|
||||||
move_members (bfd *arch, char **files_to_move)
|
move_members (bfd *arch, char **files_to_move)
|
||||||
{
|
{
|
||||||
bfd **after_bfd; /* New entries go after this one. */
|
bfd **after_bfd; /* New entries go after this one */
|
||||||
bfd **current_ptr_ptr; /* cdr pointer into contents. */
|
bfd **current_ptr_ptr; /* cdr pointer into contents */
|
||||||
const char *tmp = NULL;
|
|
||||||
|
|
||||||
for (; *files_to_move; ++files_to_move)
|
for (; *files_to_move; ++files_to_move)
|
||||||
{
|
{
|
||||||
@ -1202,11 +1195,8 @@ move_members (bfd *arch, char **files_to_move)
|
|||||||
while (*current_ptr_ptr)
|
while (*current_ptr_ptr)
|
||||||
{
|
{
|
||||||
bfd *current_ptr = *current_ptr_ptr;
|
bfd *current_ptr = *current_ptr_ptr;
|
||||||
|
if (FILENAME_CMP (normalize (*files_to_move, arch),
|
||||||
if (tmp != NULL)
|
current_ptr->filename) == 0)
|
||||||
free ((char *) tmp);
|
|
||||||
tmp = normalize (*files_to_move, arch);
|
|
||||||
if (FILENAME_CMP (tmp, current_ptr->filename) == 0)
|
|
||||||
{
|
{
|
||||||
/* Move this file to the end of the list - first cut from
|
/* Move this file to the end of the list - first cut from
|
||||||
where it is. */
|
where it is. */
|
||||||
@ -1230,13 +1220,10 @@ move_members (bfd *arch, char **files_to_move)
|
|||||||
/* xgettext:c-format */
|
/* xgettext:c-format */
|
||||||
fatal (_("no entry %s in archive %s!"), *files_to_move, arch->filename);
|
fatal (_("no entry %s in archive %s!"), *files_to_move, arch->filename);
|
||||||
|
|
||||||
next_file:
|
next_file:;
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write_archive (arch);
|
write_archive (arch);
|
||||||
if (tmp != NULL)
|
|
||||||
free ((char *) tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ought to default to replacing in place, but this is existing practice! */
|
/* Ought to default to replacing in place, but this is existing practice! */
|
||||||
|
Loading…
Reference in New Issue
Block a user