diff --git a/ChangeLog b/ChangeLog index b379c32bbe..9c22da974a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Feb 5 07:39:33 2009 Kazuhiro NISHIYAMA + + * ext/readline/readline.c (Init_readline): entry may be NULL. + [ruby-dev:37891] + Thu Feb 5 03:55:22 2009 Yukihiro Matsumoto * time.c (LOCALTIME): should call tzset() before localtime_r(). diff --git a/ext/readline/readline.c b/ext/readline/readline.c index a5dbe462e0..d8f540e026 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 }