diff options
author | Eric Wong <e@80x24.org> | 2017-03-16 19:40:36 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-03-16 19:41:21 +0000 |
commit | b265fd09f9a606582ab423e54a8d2bfb242c2620 (patch) | |
tree | ba73c6018ac39de4f769f05a6eebd670dd6c7710 | |
parent | 68b232a2b3157a4ced19c0045d4c7a937e09b442 (diff) | |
download | sleepy_penguin-b265fd09f9a606582ab423e54a8d2bfb242c2620.tar.gz |
Unlikely, but we must not leak memory if pthread_setspecific somehow fails.
-rw-r--r-- | ext/sleepy_penguin/init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/sleepy_penguin/init.c b/ext/sleepy_penguin/init.c index 01bb52f..f9671eb 100644 --- a/ext/sleepy_penguin/init.c +++ b/ext/sleepy_penguin/init.c @@ -113,6 +113,7 @@ void *rb_sp_gettlsbuf(size_t *size) buf->capa = *size; err = pthread_setspecific(rb_sp_key, buf); if (err != 0) { + free(buf); errno = err; rb_sys_fail("BUG: pthread_setspecific"); } |