aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/lib/X11/Xrm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/nx-X11/lib/X11/Xrm.c b/nx-X11/lib/X11/Xrm.c
index d88442c6e..b3d92bb48 100644
--- a/nx-X11/lib/X11/Xrm.c
+++ b/nx-X11/lib/X11/Xrm.c
@@ -1594,6 +1594,12 @@ ReadInFile(_Xconst char *filename)
*/
GetSizeOfFile(fd, size);
+ /* There might have been a problem trying to stat a file */
+ if (size == -1) {
+ close (fd);
+ return (char *)NULL;
+ }
+
if (!(filebuf = Xmalloc(size + 1))) { /* leave room for '\0' */
close(fd);
return (char *)NULL;