2011-03-10 Michael Snyder <msnyder@vmware.com>
authorMichael Snyder <msnyder@vmware.com>
Thu, 10 Mar 2011 20:09:18 +0000 (20:09 +0000)
committerMichael Snyder <msnyder@vmware.com>
Thu, 10 Mar 2011 20:09:18 +0000 (20:09 +0000)
* gdbserver/server.c (handle_v_run): Free alloced buffer on early
return.

gdb/ChangeLog
gdb/gdbserver/server.c

index 6d054a814da10c6fae4a6ad5a88225f0fe0c8dd1..e5ab2856b83aa211daa5dd299df0314531d11db8 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-10  Michael Snyder  <msnyder@vmware.com>
+
+       * gdbserver/server.c (handle_v_run): Free alloced buffer on early
+       return.
+
 2011-03-10  Tom Tromey  <tromey@redhat.com>
 
        * tracepoint.c (trace_actions_command): Update.
index 8a19809d7cac2eadcc3743caab204d3542a990e8..2f4484f71da42471191fb37201603d9ab0d9bc70 100644 (file)
@@ -1949,16 +1949,16 @@ handle_v_run (char *own_buf)
 
       if (program_argv == NULL)
        {
-         /* FIXME: new_argv memory leak */
          write_enn (own_buf);
+         freeargv (new_argv);
          return 0;
        }
 
       new_argv[0] = strdup (program_argv[0]);
       if (new_argv[0] == NULL)
        {
-         /* FIXME: new_argv memory leak */
          write_enn (own_buf);
+         freeargv (new_argv);
          return 0;
        }
     }