]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Don't zero-out rrd->__mmap_start and rrd->__mmap_size.
authorMax Khon <fjoe@samodelkin.net>
Wed, 25 Feb 2015 09:35:39 +0000 (15:35 +0600)
committerMax Khon <fjoe@samodelkin.net>
Wed, 25 Feb 2015 09:35:39 +0000 (15:35 +0600)
Otherwise free_rrd_ptr_if_not_mmapped() will try to free non-malloc'ed memory.

The error from OS X malloc debugger is:
rrdtool(34216,0x7fff7bebd300) malloc: *** error for object 0x104a09d80:
pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

src/rrd_open.c

index 614cc3c661627ecd4f384ceb66fe2980c312cb31..b4e151e2f14d2a953c89a8752b211edb7d32bac1 100644 (file)
@@ -472,8 +472,6 @@ read_check:
 #ifdef HAVE_MMAP
     if (data != MAP_FAILED)
       munmap(data, rrd_file->file_len);
-    rrd->__mmap_start = NULL;
-    rrd->__mmap_size = 0;
 #endif
 
     close(rrd_simple_file->fd);