Use release_fn() instead of free() in mono_file_map since allocation is using alloc_fn()
authorCsaba Halasz <Csaba.Halasz@gmail.com>
Thu, 15 Dec 2011 19:11:45 +0000 (20:11 +0100)
committerCsaba Halasz <Csaba.Halasz@gmail.com>
Thu, 15 Dec 2011 19:11:45 +0000 (20:11 +0100)
mono/utils/mono-filemap.c

index b557ff323315e5600c96ae953d1549d27ac29ce8..fb25eafe2666426ceaf54e9dc3185d0a99c3c6d5 100644 (file)
@@ -82,7 +82,7 @@ mono_file_map (size_t length, int flags, int fd, guint64 offset, void **ret_hand
                return NULL;
        cur_offset = lseek (fd, 0, SEEK_CUR);
        if (lseek (fd, offset, SEEK_SET) != offset) {
-               free (ptr);
+               (*release_fn) (ptr);
                return NULL;
        }
        bytes_read = read (fd, ptr, length);