From: Chip Black Date: Sun, 19 Dec 2010 11:16:37 +0000 (-0600) Subject: Whoops, what the hell was that? X-Git-Tag: ohfuckreddit~55 X-Git-Url: http://git.bytex64.net/?a=commitdiff_plain;h=f10cc7cf39e0aa34583d4d5811615211660edc8c;p=blerg.git Whoops, what the hell was that? Fix virtual address space leak -- was unmapping with the wrong size due to a spurious extra sizeof(). --- diff --git a/database.c b/database.c index 2da6530..6e9f494 100644 --- a/database.c +++ b/database.c @@ -36,7 +36,7 @@ void blerg_segment_close(struct blerg *blerg) { if (blerg->data_fd != -1) close(blerg->data_fd); if (blerg->index != NULL) - munmap((void *)blerg->index, sizeof(RECORDS_PER_SEGMENT * sizeof(struct record))); + munmap((void *)blerg->index, RECORDS_PER_SEGMENT * sizeof(struct record)); if (blerg->index_fd != -1) close(blerg->index_fd); }