about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-02-13 03:30:44 -0800
committerEric Wong <normalperson@yhbt.net>2010-02-13 03:30:44 -0800
commit9adbee0ab71bf408db5c3befb43b2bab0d86ebb2 (patch)
treef11831d89fcd23c5be32d914ea1edf0eab21106b
parentc07cf2979036b9550566d59d6d4899be98f3e553 (diff)
downloadruby_posix_mq-9adbee0ab71bf408db5c3befb43b2bab0d86ebb2.tar.gz
We still need to explicitly free the pointer we're given, and
not just close the associated file descriptor.  Fortunately most
people to not spend all day opening/closing message queue
descriptors so this leak may not be noticeable.
-rw-r--r--ext/posix_mq/posix_mq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/posix_mq/posix_mq.c b/ext/posix_mq/posix_mq.c
index 5368368..d7d4c02 100644
--- a/ext/posix_mq/posix_mq.c
+++ b/ext/posix_mq/posix_mq.c
@@ -216,8 +216,8 @@ static void _free(void *ptr)
 
                 mq_close(mq->des);
                 errno = saved_errno;
-                mq->des = MQD_INVALID;
         }
+        xfree(ptr);
 }
 
 /* automatically called at creation (before initialize) */