gdb/
* cli/cli-cmds.c (find_and_open_script): Handle failure of fdopen.
This commit is contained in:
parent
a71b5a3812
commit
77a35dd897
2 changed files with 15 additions and 0 deletions
|
@ -513,6 +513,17 @@ find_and_open_script (const char *script_file, int search_path,
|
|||
do_cleanups (old_cleanups);
|
||||
|
||||
*streamp = fdopen (fd, FOPEN_RT);
|
||||
if (*streamp == NULL)
|
||||
{
|
||||
int save_errno = errno;
|
||||
|
||||
close (fd);
|
||||
if (full_pathp)
|
||||
xfree (*full_pathp);
|
||||
errno = save_errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue