]> git.saurik.com Git - cydia.git/commitdiff
If Cytore fails to allocate an empty file, unlink.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 29 Jan 2017 15:32:55 +0000 (07:32 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 29 Jan 2017 15:32:55 +0000 (07:32 -0800)
Cytore.hpp

index 714da2663658fc80b24f46605a6e71f2b6b99eb1..a382dd87cfab1d0d812040c3683823fe6f3f06b2 100644 (file)
@@ -190,7 +190,11 @@ class File {
 
         size_t size(stat.st_size);
         if (size == 0) {
 
         size_t size(stat.st_size);
         if (size == 0) {
-            _assert(Truncate_(core));
+            if (!Truncate_(core)) {
+                unlink(path);
+                _assert(false);
+            }
+
             Header_().magic_ = Magic;
             Size_() = core;
         } else {
             Header_().magic_ = Magic;
             Size_() = core;
         } else {