diff options
author | Doug Evans <dje@google.com> | 2008-03-24 17:11:21 +0000 |
---|---|---|
committer | Doug Evans <devans@gcc.gnu.org> | 2008-03-24 17:11:21 +0000 |
commit | 01b119402f3f7e1edf6e72ad00499ba1ff80cb8e (patch) | |
tree | 7aba473013d7fef5e05c75553cc630696e7cff2d /libiberty/make-relative-prefix.c | |
parent | 1b24a790e0f4443ebbe19977f66378f60b059269 (diff) |
make-relative-prefix.c (make_relative_prefix_1): Handle NULL return from strdup.
* make-relative-prefix.c (make_relative_prefix_1): Handle NULL
return from strdup.
From-SVN: r133482
Diffstat (limited to 'libiberty/make-relative-prefix.c')
-rw-r--r-- | libiberty/make-relative-prefix.c | 12 |
1 files changed, 5 insertions, 7 deletions
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); |