* cli/cli-cmds.c (find_and_open_script): Handle failure of fdopen.
+2012-01-23 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * cli/cli-cmds.c (find_and_open_script): Handle failure of fdopen.
+
2012-01-23 Ulrich Weigand <ulrich.weigand@linaro.org>
* inf-child.c: Include "gdb_stat.h" instead of <sys/stat.h>.
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;
}