Bug #6235

Call to malloc not checked in thread_pthread.c

Added by Ruby Submit about 2 years ago. Updated almost 2 years ago.

[ruby-core:43960]
Status:Closed
Priority:Normal
Assignee:Koichi Sasada
Category:-
Target version:-
ruby -v:ruby 1.9.2p290 Backport:

Description

File: thread_pthread.c

struct cachedthreadentry *entry =
(struct cachedthreadentry *)malloc(sizeof(struct cachedthreadentry));

struct timeval tv;
struct timespec ts;
gettimeofday(&tv, 0);
ts.tv_sec = tv.tv_sec + 60;
ts.tv_nsec = tv.tv_usec * 1000;

pthread_mutex_lock(&thread_cache_lock);
{
entry->th_area = &th_area;

Associated revisions

Revision 36222
Added by Koichi Sasada almost 2 years ago

  • threadpthread.c (registercachedthreadand_wait): return immediately if malloc() failed. [ruby-trunk - Bug #6235]
  • threadpthread.c (USETHREAD_CACHE): check already defined or not.

History

#1 Updated by Yusuke Endoh about 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Motohiro KOSAKI

#2 Updated by Koichi Sasada about 2 years ago

  • Assignee changed from Motohiro KOSAKI to Koichi Sasada

I'll fix it.

#3 Updated by Koichi Sasada almost 2 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r36222.
Ruby, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • threadpthread.c (registercachedthreadand_wait): return immediately if malloc() failed. [ruby-trunk - Bug #6235]
  • threadpthread.c (USETHREAD_CACHE): check already defined or not.

Also available in: Atom PDF