about summary refs log tree commit diff
path: root/src/nix-worker/nix-worker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-worker/nix-worker.cc')
-rw-r--r--src/nix-worker/nix-worker.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc
index 0be4b8e64cc4..17fbbf264693 100644
--- a/src/nix-worker/nix-worker.cc
+++ b/src/nix-worker/nix-worker.cc
@@ -240,6 +240,7 @@ static void performOp(Source & from, Sink & to, unsigned int op)
         string hashAlgo = readString(from);
         
         Path tmp = createTempDir();
+        AutoDelete delTmp(tmp);
         Path tmp2 = tmp + "/" + baseName;
         restorePath(tmp2, from);
 
@@ -248,8 +249,6 @@ static void performOp(Source & from, Sink & to, unsigned int op)
         stopWork();
         
         writeString(path, to);
-            
-        deletePath(tmp);
         break;
     }