Browse code

correctly remove patches after applying

git-svn: trunk@2198

Tomasz Kojm authored on 2006/08/16 07:45:05
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Aug 16 00:41:30 CEST 2006 (tk)
2
+----------------------------------
3
+  * freshclam/manager.c: correctly remove patches after applying
4
+
1 5
 Tue Aug 15 16:07:11 BST 2006 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/pdf.c:	Windows fix: handle more than 26 temporary files in
... ...
@@ -699,7 +699,6 @@ static int getpatch(const char *dbname, int version, const char *hostname, char
699 699
         logg("!getpatch: Can't download %s from %s (IP: %s)\n", patch, hostname, ip);
700 700
         unlink(tempname);
701 701
         free(tempname);
702
-	unlink(patch);
703 702
 	chdir(olddir);
704 703
         return ret;
705 704
     }
... ...
@@ -708,7 +707,6 @@ static int getpatch(const char *dbname, int version, const char *hostname, char
708 708
 	logg("!getpatch: Can't open %s for reading\n", tempname);
709 709
         unlink(tempname);
710 710
         free(tempname);
711
-	unlink(patch);
712 711
 	chdir(olddir);
713 712
 	return 55;
714 713
     }
... ...
@@ -718,13 +716,13 @@ static int getpatch(const char *dbname, int version, const char *hostname, char
718 718
 	close(fd);
719 719
         unlink(tempname);
720 720
         free(tempname);
721
-	unlink(patch);
722 721
 	chdir(olddir);
723 722
 	return 70; /* FIXME */
724 723
     }
725 724
 
726 725
     close(fd);
727
-    unlink(patch);
726
+    unlink(tempname);
727
+    free(tempname);
728 728
     chdir(olddir);
729 729
     return 0;
730 730
 }