summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-08 04:46:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-08 04:46:57 +0000
commitff84a6a2e7904a5f6cf7d778c6b9f7af4c87d818 (patch)
tree8da730a095c40e12d2db4f28cf8c7ec699f913c9
parent119d66232db60742c0110cb0019f41f912ae3aaf (diff)
ext/dl, ext/fiddle: fix memory leak
* 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]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--ext/dl/cptr.c1
-rw-r--r--ext/dl/handle.c1
-rw-r--r--ext/fiddle/handle.c1
-rw-r--r--ext/fiddle/pointer.c1
5 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7eb83215ac..f05c90a653 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Mar 8 13:46:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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 <nobu@ruby-lang.org>
* process.c (obj2uid, obj2gid): now getpwnam_r() and getgrnam_r()
diff --git a/ext/dl/cptr.c b/ext/dl/cptr.c
index 62ab3895b2..7a82c7c3e0 100644
--- a/ext/dl/cptr.c
+++ b/ext/dl/cptr.c
@@ -49,6 +49,7 @@ dlptr_free(void *ptr)
(*(data->free))(data->ptr);
}
}
+ xfree(ptr);
}
static size_t
diff --git a/ext/dl/handle.c b/ext/dl/handle.c
index ef182e816f..6b90e089ee 100644
--- a/ext/dl/handle.c
+++ b/ext/dl/handle.c
@@ -38,6 +38,7 @@ dlhandle_free(void *ptr)
if( dlhandle->ptr && dlhandle->open && dlhandle->enable_close ){
dlclose(dlhandle->ptr);
}
+ xfree(ptr);
}
static size_t
diff --git a/ext/fiddle/handle.c b/ext/fiddle/handle.c
index 330dbafe67..36970a2248 100644
--- a/ext/fiddle/handle.c
+++ b/ext/fiddle/handle.c
@@ -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
diff --git a/ext/fiddle/pointer.c b/ext/fiddle/pointer.c
index 0a914dd4a9..a09daf77ea 100644
--- a/ext/fiddle/pointer.c
+++ b/ext/fiddle/pointer.c
@@ -65,6 +65,7 @@ fiddle_ptr_free(void *ptr)
(*(data->free))(data->ptr);
}
}
+ xfree(ptr);
}
static size_t