summaryrefslogtreecommitdiff
path: root/ext/stringio/stringio.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-23 16:22:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-23 16:22:25 +0000
commitb596fbbc375ea58aa2b869cb6025b2bb101f96b9 (patch)
tree6ffd75b09e418bcbbb5750440a8e2f4f9c37d81d /ext/stringio/stringio.c
parentad8dbab8887bccb5dc997071d5d11d3d36dd62b4 (diff)
* ext/stringio/stringio.c (strio_mark): must check if ptr is NULL
first. [ruby-talk:38873] * lib/mkmf.rb (create_makefile): should print depend file when make is other than nmake. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/stringio/stringio.c')
-rw-r--r--ext/stringio/stringio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 11fe8ef455..07ee38dd48 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -53,7 +53,9 @@ static void
strio_mark(ptr)
struct StringIO *ptr;
{
- rb_gc_mark(ptr->string);
+ if (ptr) {
+ rb_gc_mark(ptr->string);
+ }
}
static void
@@ -181,7 +183,6 @@ static VALUE
strio_s_allocate(klass)
VALUE klass;
{
- struct StringIO *ptr;
return Data_Wrap_Struct(klass, strio_mark, strio_free, 0);
}