git-svn: trunk@2127
Tomasz Kojm authored on 2006/07/27 00:27:02... | ... |
@@ -687,6 +687,7 @@ static int getpatch(const char *dbname, int version, const char *hostname, char |
687 | 687 |
logg("!getpatch: Can't download %s from %s (IP: %s)\n", patch, hostname, ip); |
688 | 688 |
unlink(tempname); |
689 | 689 |
free(tempname); |
690 |
+ unlink(patch); |
|
690 | 691 |
chdir(olddir); |
691 | 692 |
return ret; |
692 | 693 |
} |
... | ... |
@@ -695,18 +696,22 @@ static int getpatch(const char *dbname, int version, const char *hostname, char |
695 | 695 |
logg("!getpatch: Can't open %s for reading\n", tempname); |
696 | 696 |
unlink(tempname); |
697 | 697 |
free(tempname); |
698 |
+ unlink(patch); |
|
698 | 699 |
chdir(olddir); |
699 | 700 |
return 55; |
700 | 701 |
} |
701 | 702 |
|
702 | 703 |
if(cdiff_apply(fd) == -1) { |
703 | 704 |
logg("!getpatch: Can't apply patch\n"); |
705 |
+ close(fd); |
|
704 | 706 |
unlink(tempname); |
705 | 707 |
free(tempname); |
708 |
+ unlink(patch); |
|
706 | 709 |
chdir(olddir); |
707 | 710 |
return 70; /* FIXME */ |
708 | 711 |
} |
709 | 712 |
|
713 |
+ close(fd); |
|
710 | 714 |
chdir(olddir); |
711 | 715 |
return 0; |
712 | 716 |
} |
... | ... |
@@ -901,6 +906,8 @@ int updatedb(const char *dbname, const char *hostname, char *ip, int *signo, con |
901 | 901 |
ret = getcvd(dbfile, hostname, ip, localip, proxy, port, user, pass, uas, nodb, newver); |
902 | 902 |
if(ret) |
903 | 903 |
return ret; |
904 |
+ } else { |
|
905 |
+ unlink(dbfile); |
|
904 | 906 |
} |
905 | 907 |
} |
906 | 908 |
|