Remove cleanups from prepare_execute_command
[deliverable/binutils-gdb.git] / gdb / xml-support.c
index 1f53d7af54c48af9d37da669f21d0186e2a43b67..2b59180c92c868868d0b4e380d0ec7347c0511f6 100644 (file)
@@ -1025,8 +1025,8 @@ xml_fetch_content_from_file (const char *filename, void *baton)
 
   gdb::unique_xmalloc_ptr<char> text ((char *) xmalloc (len + 1));
 
-  fread (text.get (), 1, len, file.get ());
-  if (ferror (file.get ()))
+  if (fread (text.get (), 1, len, file.get ()) != len
+      || ferror (file.get ()))
     {
       warning (_("Read error from \"%s\""), filename);
       return NULL;
This page took 0.024427 seconds and 4 git commands to generate.