aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-06-17 20:29:42 +0000
committerTom Tromey <tromey@redhat.com>2009-06-17 20:29:42 +0000
commitaffddf13813eefe252c923001e09e7582adb8cfd (patch)
treee719be29106b1418f800aabeae0923b05d8b73c9 /gdb
parent9898f801b47255d0f1dee8c7a2238369e34adcd1 (diff)
downloadgdb-affddf13813eefe252c923001e09e7582adb8cfd.zip
gdb-affddf13813eefe252c923001e09e7582adb8cfd.tar.gz
gdb-affddf13813eefe252c923001e09e7582adb8cfd.tar.bz2
* dwarf2read.c (zlib_decompress_section): Use a cleanup.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/dwarf2read.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6755807..3e178ae 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-17 Tom Tromey <tromey@redhat.com>
+
+ * dwarf2read.c (zlib_decompress_section): Use a cleanup.
+
2009-06-17 Ulrich Weigand <uweigand@de.ibm.com>
* gdbarch.sh (pointer_to_address): Change to type 'm'.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index ae8870c..f02d65f 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1208,6 +1208,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp,
#else
bfd_size_type compressed_size = bfd_get_section_size (sectp);
gdb_byte *compressed_buffer = xmalloc (compressed_size);
+ struct cleanup *cleanup = make_cleanup (xfree, compressed_buffer);
bfd_size_type uncompressed_size;
gdb_byte *uncompressed_buffer;
z_stream strm;
@@ -1264,7 +1265,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp,
error (_("Dwarf Error: concluding DWARF uncompression in '%s': %d"),
bfd_get_filename (abfd), rc);
- xfree (compressed_buffer);
+ do_cleanups (cleanup);
*outbuf = uncompressed_buffer;
*outsize = uncompressed_size;
#endif