Replace malloc/free with new/delete to fix parallel-reading crash

This commit is contained in:
Eric Fischer
2016-08-30 14:02:51 -07:00
parent 31d2a3738a
commit d4e1ee0627
4 changed files with 28 additions and 23 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ struct memfile *memfile_open(int fd) {
return NULL;
}
struct memfile *mf = (struct memfile *) malloc(sizeof(struct memfile));
struct memfile *mf = new memfile;
if (mf == NULL) {
munmap(map, INCREMENT);
return NULL;
@@ -42,7 +42,7 @@ int memfile_close(struct memfile *file) {
}
}
free(file);
delete file;
return 0;
}