(Where "exits" includes being killed or detached.)
Nothing is clearing inferior->priv currently.  This is a problem if we
change the inferior's process_stratum targets in a single debug
session.  This field is currently only used by darwin-nat.c, but a
follow up patch will make remote.c use it too.  Without the fix,
remote.c might end up mistaking the priv object allocated by
darwin-nat.c with its own.
(Found by inspection.)
gdb/ChangeLog:
2016-10-26  Pedro Alves  <palves@redhat.com>
	* inferior.c (exit_inferior_1): Free 'priv'.
+2016-10-26  Pedro Alves  <palves@redhat.com>
+
+       * inferior.c (exit_inferior_1): Free 'priv'.
+
 2016-10-26  Pedro Alves  <palves@redhat.com>
 
        * remote.c (remote_resume_with_hc): New function, factored out
 
 
   inf->pid = 0;
   inf->fake_pid_p = 0;
+  xfree (inf->priv);
+  inf->priv = NULL;
+
   if (inf->vfork_parent != NULL)
     {
       inf->vfork_parent->vfork_child = NULL;