aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2007-08-03 19:49:44 +0000
committerDJ Delorie <dj@redhat.com>2007-08-03 19:49:44 +0000
commit9250f7f0d29e4d4a5d40b2c77daa78d9438d7ead (patch)
treed6970f8a9bec73381088c58564b0e7b3fe123cc6 /libiberty
parentb8deab3780678d3d2113fdc360462899a476be7d (diff)
downloadbinutils-9250f7f0d29e4d4a5d40b2c77daa78d9438d7ead.zip
binutils-9250f7f0d29e4d4a5d40b2c77daa78d9438d7ead.tar.gz
binutils-9250f7f0d29e4d4a5d40b2c77daa78d9438d7ead.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/make-relative-prefix.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index aee3cc7..28e2c4f 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-03 Michael Snyder <msnyder@access-company.com>
+
+ * make-relative-prefix.c (make_relative_prefix_1): Fix resource
+ leak.
+
2007-07-31 Michael Snyder <msnyder@access-company.com>
* cp-demangle.c (d_print_comp): Guard against null.
diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c
index 037809e..be61040 100644
--- a/libiberty/make-relative-prefix.c
+++ b/libiberty/make-relative-prefix.c
@@ -299,11 +299,17 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix,
full_progname = strdup(progname);
prog_dirs = split_directories (full_progname, &prog_num);
- bin_dirs = split_directories (bin_prefix, &bin_num);
free (full_progname);
- if (bin_dirs == NULL || prog_dirs == NULL)
+ if (prog_dirs == NULL)
return NULL;
+ bin_dirs = split_directories (bin_prefix, &bin_num);
+ if (bin_dirs == NULL)
+ {
+ free_split_directories (prog_dirs);
+ return NULL;
+ }
+
/* Remove the program name from comparison of directory names. */
prog_num--;