diff --git a/ext/libmagic/magic.c b/ext/libmagic/magic.c index 6ced276..f89fe8b 100644 --- a/ext/libmagic/magic.c +++ b/ext/libmagic/magic.c @@ -25,10 +25,10 @@ VALUE rb_eIsDirError ; VALUE rb_eFileClosedError ; // Garbage collect -void file_free(void **data) { - if(*data) { - magic_close(*data) ; - *data = NULL ; +void file_free(void *data) { + if(data) { + magic_close(*(void **)data) ; + *(void **)data = NULL ; } free(data) ;