summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <a3li@gentoo.org>2010-08-24 18:35:57 +0200
committerAlex Legler <a3li@gentoo.org>2010-08-24 18:35:57 +0200
commit47d70eee28370726e80dc0f83bfb109fc262133a (patch)
treec4e02a4eddda597e4a870ad5fa9ed85eea31337d /patchsets/patches-1.8.7_p302/001_memory_leak.patch
parentAdd 1.8.6-p399 patchset (diff)
downloadruby-scripts-47d70eee28370726e80dc0f83bfb109fc262133a.tar.gz
ruby-scripts-47d70eee28370726e80dc0f83bfb109fc262133a.tar.bz2
ruby-scripts-47d70eee28370726e80dc0f83bfb109fc262133a.zip
Add 1.8.7_p302 patchsetpatches-1.8.7_p302
Diffstat (limited to 'patchsets/patches-1.8.7_p302/001_memory_leak.patch')
-rw-r--r--patchsets/patches-1.8.7_p302/001_memory_leak.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/patchsets/patches-1.8.7_p302/001_memory_leak.patch b/patchsets/patches-1.8.7_p302/001_memory_leak.patch
new file mode 100644
index 0000000..98edae0
--- /dev/null
+++ b/patchsets/patches-1.8.7_p302/001_memory_leak.patch
@@ -0,0 +1,59 @@
+Index: ruby-1.8.7-p299/ext/dl/handle.c
+===================================================================
+--- ruby-1.8.7-p299.orig/ext/dl/handle.c
++++ ruby-1.8.7-p299/ext/dl/handle.c
+@@ -10,9 +10,12 @@ VALUE rb_cDLHandle;
+ void
+ dlhandle_free(struct dl_handle *dlhandle)
+ {
++ if (!dlhandle)
++ return;
+ if (dlhandle->ptr && dlhandle->open && dlhandle->enable_close) {
+ dlclose(dlhandle->ptr);
+ }
++ dlfree(dlhandle);
+ }
+
+ VALUE
+Index: ruby-1.8.7-p299/ext/dl/ptr.c
+===================================================================
+--- ruby-1.8.7-p299.orig/ext/dl/ptr.c
++++ ruby-1.8.7-p299/ext/dl/ptr.c
+@@ -45,6 +45,8 @@ rb_dlmem_aref(void *ptr)
+ void
+ dlptr_free(struct ptr_data *data)
+ {
++ if (!data)
++ return;
+ if (data->ptr) {
+ DEBUG_CODE({
+ printf("dlptr_free(): removing the pointer `0x%x' from the MemorySpace\n",
+@@ -61,6 +63,7 @@ dlptr_free(struct ptr_data *data)
+ if (data->stype) dlfree(data->stype);
+ if (data->ssize) dlfree(data->ssize);
+ if (data->ids) dlfree(data->ids);
++ dlfree(data);
+ }
+
+ void
+Index: ruby-1.8.7-p299/ext/dl/sym.c
+===================================================================
+--- ruby-1.8.7-p299.orig/ext/dl/sym.c
++++ ruby-1.8.7-p299/ext/dl/sym.c
+@@ -57,6 +57,8 @@ char2type(int ch)
+ void
+ dlsym_free(struct sym_data *data)
+ {
++ if(!data)
++ return;
+ if( data->name ){
+ DEBUG_CODE({
+ printf("dlsym_free(): free(data->name:%s)\n",data->name);
+@@ -69,6 +71,7 @@ dlsym_free(struct sym_data *data)
+ });
+ free(data->type);
+ }
++ dlfree(data);
+ }
+
+ VALUE