Prevent leaks in ThreadLocalPtr initialization
authorChad Parry <cparry@fb.com>
Thu, 12 May 2016 18:46:42 +0000 (11:46 -0700)
committerFacebook Github Bot 4 <facebook-github-bot-4-bot@fb.com>
Thu, 12 May 2016 18:50:22 +0000 (11:50 -0700)
commit34986bb445bd32bdcf729ae1820971c06a9c5cd2
treed40b27374e6e80ef71fe8e57b0847e50fb5930ee
parentda5b283895300f51440700beb0938b6588ea3965
Prevent leaks in ThreadLocalPtr initialization

Summary: While making an unrelated change, (D3271563, which was needed from an unrelated change, (D3237530)), I noticed a lack of exception safety here. If `std::bad_alloc` were thrown, then we don't want to leak memory.

Reviewed By: ericniebler

Differential Revision: D3271911

fbshipit-source-id: 0d316c0fa865a7d64622c1d62160bb0c2b061d78
folly/ThreadLocal.h
folly/detail/ThreadLocalDetail.h