summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authordevans <devans@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-24 17:11:21 +0000
committerdevans <devans@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-24 17:11:21 +0000
commitbe42496cde4eb1a974bd8f595417a03a8a171364 (patch)
tree7aba473013d7fef5e05c75553cc630696e7cff2d /libiberty
parent80296012ed153e5cde53efa55b391e1e6d6c3231 (diff)
downloadgcc-be42496cde4eb1a974bd8f595417a03a8a171364.tar.gz
* make-relative-prefix.c (make_relative_prefix_1): Handle NULL
return from strdup. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133482 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/make-relative-prefix.c12
2 files changed, 10 insertions, 7 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index fad27c31414..547007a5238 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-24 Doug Evans <dje@google.com>
+
+ * make-relative-prefix.c (make_relative_prefix_1): Handle NULL
+ return from strdup.
+
2008-03-12 Seongbae Park <seongbae.park@gmail.com>
* cplus-dem.c (malloc, realloc): Use void * instead of char *
diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c
index 80e7f92fb41..c98d287d7c0 100644
--- a/libiberty/make-relative-prefix.c
+++ b/libiberty/make-relative-prefix.c
@@ -292,14 +292,12 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix,
}
}
- if ( resolve_links )
- {
- full_progname = lrealpath (progname);
- if (full_progname == NULL)
- return NULL;
- }
+ if (resolve_links)
+ full_progname = lrealpath (progname);
else
- full_progname = strdup(progname);
+ full_progname = strdup (progname);
+ if (full_progname == NULL)
+ return NULL;
prog_dirs = split_directories (full_progname, &prog_num);
free (full_progname);