*** dump.c.ORIG Mon Sep 4 23:28:18 2006 --- dump.c Mon Jul 16 03:25:44 2007 *************** *** 248,253 **** --- 248,255 ---- if ((dump = fdopen(dumpfd, "w")) == NULL) { mg_log(LOG_ERR, "cannot write dumpfile \"%s\": %s", newdumpfile, strerror(errno)); + close(dumpfd); + unlink(newdumpfile); /* clean up ... */ exit(EX_OSERR); } *************** *** 276,281 **** --- 278,284 ---- if (rename(newdumpfile, conf.c_dumpfile) != 0) { mg_log(LOG_ERR, "cannot replace \"%s\" by \"%s\": %s\n", conf.c_dumpfile, newdumpfile, strerror(errno)); + unlink(newdumpfile); /* clean up ... */ exit(EX_OSERR); }