gdb/
[deliverable/binutils-gdb.git] / gdb / gdbserver / hostio.c
index 99014bcdeb250e90ea5a7a2e2c02612bab5abedd..7105013485b2ed2a2ab2d6159140e2e28221ae3d 100644 (file)
@@ -134,7 +134,10 @@ require_data (char *p, int p_len, char **data, int *data_len)
     }
 
   if (escaped)
-    return -1;
+    {
+      free (*data);
+      return -1;
+    }
 
   *data_len = output_index;
   return 0;
@@ -415,7 +418,8 @@ handle_close (char *own_buf)
     }
 
   open_fd_p = &open_fds;
-  while (*open_fd_p && (*open_fd_p)->fd != fd)
+  /* We know that fd is in the list, thanks to require_valid_fd.  */
+  while ((*open_fd_p)->fd != fd)
     open_fd_p = &(*open_fd_p)->next;
 
   old_fd = *open_fd_p;
This page took 0.024281 seconds and 4 git commands to generate.