fish: Fix segfault in free_drives() function.
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 22 Sep 2010 10:59:58 +0000 (11:59 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 22 Sep 2010 10:59:58 +0000 (11:59 +0100)
This updates commit 8ea62c8d7f3f7f7e4057b93105cf979271aa13f4
so it doesn't try to free the optarg (stack-allocated) strings.

fish/fish.c

index 6192860..4379845 100644 (file)
@@ -701,8 +701,8 @@ free_drives (struct drv *drv)
   free_drives (drv->next);
 
   switch (drv->type) {
-  case drv_a: free (drv->a.filename); break;
-  case drv_d: free (drv->d.guest); break;
+  case drv_a: /* a.filename is optarg, don't free it */ break;
+  case drv_d: /* d.filename is optarg, don't free it */ break;
   case drv_N:
     free (drv->N.filename);
     free (drv->N.device);