Skip to content

Commit

Permalink
ext/dl, ext/fiddle: fix memory leak
Browse files Browse the repository at this point in the history
* ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
  ext/fiddle/handle.c (fiddle_handle_free),
  ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
  based on the patch Heesob Park at [ruby-dev:48021] [Bug ruby#9599].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Mar 8, 2014
1 parent 119d662 commit ff84a6a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Sat Mar 8 13:46:40 2014 Nobuyoshi Nakada <[email protected]>

* ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
ext/fiddle/handle.c (fiddle_handle_free),
ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
based on the patch Heesob Park at [ruby-dev:48021] [Bug #9599].

Sat Mar 8 13:30:39 2014 Nobuyoshi Nakada <[email protected]>

* process.c (obj2uid, obj2gid): now getpwnam_r() and getgrnam_r()
Expand Down
1 change: 1 addition & 0 deletions ext/dl/cptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dlptr_free(void *ptr)
(*(data->free))(data->ptr);
}
}
xfree(ptr);
}

static size_t
Expand Down
1 change: 1 addition & 0 deletions ext/dl/handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dlhandle_free(void *ptr)
if( dlhandle->ptr && dlhandle->open && dlhandle->enable_close ){
dlclose(dlhandle->ptr);
}
xfree(ptr);
}

static size_t
Expand Down
1 change: 1 addition & 0 deletions ext/fiddle/handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fiddle_handle_free(void *ptr)
if( fiddle_handle->ptr && fiddle_handle->open && fiddle_handle->enable_close ){
dlclose(fiddle_handle->ptr);
}
xfree(ptr);
}

static size_t
Expand Down
1 change: 1 addition & 0 deletions ext/fiddle/pointer.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ fiddle_ptr_free(void *ptr)
(*(data->free))(data->ptr);
}
}
xfree(ptr);
}

static size_t
Expand Down

0 comments on commit ff84a6a

Please sign in to comment.