diff options
author | Michael Snyder <msnyder@vmware.com> | 2007-08-08 18:08:52 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2007-08-08 18:08:52 +0000 |
commit | ea5bf0a1f9f5ebc127b1982c31a7abb27b36c563 (patch) | |
tree | 8ec42a0ea0b64e068fc2b682f8da9177eb1c6edb /gdb/solib-svr4.c | |
parent | 34e2dfde9ce629d445efdda8a472cd8035a8a2c8 (diff) | |
download | gdb-ea5bf0a1f9f5ebc127b1982c31a7abb27b36c563.zip gdb-ea5bf0a1f9f5ebc127b1982c31a7abb27b36c563.tar.gz gdb-ea5bf0a1f9f5ebc127b1982c31a7abb27b36c563.tar.bz2 |
2007-08-08 Michael Snyder <msnyder@access-company.com>
* solib-svr4.c (open_symbol_file_object): Memory leak.
(svr4_current_sos): Ditto.
(enable_break): Ditto.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r-- | gdb/solib-svr4.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index fc608de..9b72a57 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -623,6 +623,7 @@ open_symbol_file_object (void *from_ttyp) /* Now fetch the filename from target memory. */ target_read_string (l_name, &filename, SO_NAME_MAX_PATH_SIZE - 1, &errcode); + make_cleanup (xfree, filename); if (errcode) { @@ -631,7 +632,6 @@ open_symbol_file_object (void *from_ttyp) return 0; } - make_cleanup (xfree, filename); /* Have a pathname: read the symbol file. */ symbol_file_add_main (filename, from_tty); @@ -751,9 +751,9 @@ svr4_current_sos (void) { strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; - xfree (buffer); strcpy (new->so_original_name, new->so_name); } + xfree (buffer); /* If this entry has no name, or its name matches the name for the main executable, don't include it in the list. */ @@ -1008,6 +1008,7 @@ enable_break (void) tmp_fd = solib_open (buf, &tmp_pathname); if (tmp_fd >= 0) tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd); + xfree (tmp_pathname); if (tmp_bfd == NULL) goto bkpt_at_symbol; |