shithub: clone

Download patch

ref: 9ffb694797cfae556b8e1c9b07865d5e828d53fc
parent: 91b8745cbe7660883d512157dc982a1b31e9f7e5
author: kvik <[email protected]>
date: Wed Mar 13 09:38:06 EDT 2019

fix double-free

--- a/clone.c
+++ b/clone.c
@@ -480,7 +480,6 @@
 	
 	threadsetname("fileproc");
 	
-	dst = nil;
 	wg = v;
 	for(;;){
 		f = recvp(filechan);
@@ -487,6 +486,7 @@
 		if(f == nil)
 			break;
 
+		dst = nil;
 		f->sfd = open(f->src, OREAD);
 		if(f->sfd < 0){
 			error("can't open: %r");