* cli/cli-cmds.c (source_script): Clean up full_pathname. Run
cleanups on early return.
This commit is contained in:
parent
17ceb93675
commit
b03a6ea40e
2 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-11-10 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* cli/cli-cmds.c (source_script): Clean up full_pathname. Run
|
||||||
|
cleanups on early return.
|
||||||
|
|
||||||
2008-11-09 Vladimir Prus <vladimir@codesourcery.com>
|
2008-11-09 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
Kill pthread_ops_hack
|
Kill pthread_ops_hack
|
||||||
|
|
|
@ -450,6 +450,7 @@ source_script (char *file, int from_tty)
|
||||||
files. Put the full location in 'full_pathname'. */
|
files. Put the full location in 'full_pathname'. */
|
||||||
fd = openp (source_path, OPF_TRY_CWD_FIRST,
|
fd = openp (source_path, OPF_TRY_CWD_FIRST,
|
||||||
file, O_RDONLY, 0, &full_pathname);
|
file, O_RDONLY, 0, &full_pathname);
|
||||||
|
make_cleanup (xfree, full_pathname);
|
||||||
|
|
||||||
/* Use the full path name, if it is found. */
|
/* Use the full path name, if it is found. */
|
||||||
if (full_pathname != NULL && fd != -1)
|
if (full_pathname != NULL && fd != -1)
|
||||||
|
@ -462,7 +463,10 @@ source_script (char *file, int from_tty)
|
||||||
if (from_tty)
|
if (from_tty)
|
||||||
perror_with_name (file);
|
perror_with_name (file);
|
||||||
else
|
else
|
||||||
return;
|
{
|
||||||
|
do_cleanups (old_cleanups);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stream = fdopen (fd, FOPEN_RT);
|
stream = fdopen (fd, FOPEN_RT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue