mirror of git://gcc.gnu.org/git/gcc.git
make-relative-prefix.c (make_relative_prefix_1): Fix resource leak.
* make-relative-prefix.c (make_relative_prefix_1): Fix resource leak. From-SVN: r127183
This commit is contained in:
parent
7475160c8d
commit
fd83e38711
|
@ -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>
|
2007-07-31 Michael Snyder <msnyder@access-company.com>
|
||||||
|
|
||||||
* cp-demangle.c (d_print_comp): Guard against null.
|
* cp-demangle.c (d_print_comp): Guard against null.
|
||||||
|
|
|
@ -299,11 +299,17 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix,
|
||||||
full_progname = strdup(progname);
|
full_progname = strdup(progname);
|
||||||
|
|
||||||
prog_dirs = split_directories (full_progname, &prog_num);
|
prog_dirs = split_directories (full_progname, &prog_num);
|
||||||
bin_dirs = split_directories (bin_prefix, &bin_num);
|
|
||||||
free (full_progname);
|
free (full_progname);
|
||||||
if (bin_dirs == NULL || prog_dirs == NULL)
|
if (prog_dirs == NULL)
|
||||||
return 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. */
|
/* Remove the program name from comparison of directory names. */
|
||||||
prog_num--;
|
prog_num--;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue