WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Fix double-free in tapdisk cleanup

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix double-free in tapdisk cleanup
From: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
Date: Mon, 27 Aug 2007 15:02:37 -0400
Cc: Josh Nicholas <jnicholas@xxxxxxxxxxxxxxx>
Delivery-date: Mon, 27 Aug 2007 12:18:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.5 (X11/20070719)
Fixed double-free() during normal tapdisk cleanup for quit process

Signed-off-by: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
Signed-off-by: Josh Nicholas <jnicholas@xxxxxxxxxxxxxxx>

diff -r 58aa2447f212 tools/blktap/drivers/tapdisk.c
--- a/tools/blktap/drivers/tapdisk.c    Wed Jul 11 15:26:55 2007 -0400
+++ b/tools/blktap/drivers/tapdisk.c    Wed Jul 11 15:26:58 2007 -0400
@@ -849,6 +849,8 @@ int main(int argc, char *argv[])
                exit(-1);
        }
 
+       DPRINTF("running R: '%s' W: '%s'\n", argv[1], argv[2]);
+
        while (run) 
         {
                ret = 0;
@@ -914,12 +916,13 @@ int main(int argc, char *argv[])
                s = ptr->s;
 
                unmap_disk(s);
-               free(s->blkif);
-               free(s->ring_info);
-               free(s);
+
                close(ptr->tap_fd);
                ptr = ptr->next;
        }
+
+       DPRINTF("done R: '%s' W: '%s'\n", argv[1], argv[2]);
+
        closelog();
 
        return 0;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix double-free in tapdisk cleanup, Ben Guthro <=