Skip to content

Commit

Permalink
Fix: Update file_free to match Ruby 3.3's dfree signature requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Souravgoswami committed Sep 25, 2024
1 parent cf0f16f commit 27de7df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ext/libmagic/magic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ;
Expand Down

0 comments on commit 27de7df

Please sign in to comment.