summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-04 22:42:06 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-04 22:42:06 +0000
commit37131afdd31b8c3d272dff74de3b76873791991e (patch)
tree95b540fefb7da61c57481442d76186c254e54c2d /ext/readline
parentb5ae8db530b3f091f5803bc0db3e8b5cbe237d2d (diff)
* ext/readline/readline.c (Init_readline): entry may be NULL.
[ruby-dev:37891] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index a5dbe46..d8f540e 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -1349,8 +1349,10 @@ Init_readline()
#else
{
HIST_ENTRY *entry = remove_history(0);
- free((char *)entry->line);
- free(entry);
+ if (entry) {
+ free((char *)entry->line);
+ free(entry);
+ }
}
#endif
}