Skip to content

Fix a leak in BinaryReader::ReadVector - #8453

Open
saagarjha wants to merge 1 commit into
devfrom
binaryreader_leak
Open

Fix a leak in BinaryReader::ReadVector#8453
saagarjha wants to merge 1 commit into
devfrom
binaryreader_leak

Conversation

@saagarjha

Copy link
Copy Markdown
Contributor

The new behavior requires that T is value initializable but generally you have no business calling this function if that is not the case, so this should be fine.

The new behavior requires that T is value initializable but generally
you have no business calling this function if that is not the case, so
this should be fine.
@CouleeApps

Copy link
Copy Markdown
Member
  1. Wow good find
  2. Any reason to value-initialize instead of reserve() ?

@saagarjha

Copy link
Copy Markdown
Contributor Author

reserve doesn't change the vector's size which means it mostly just changes the backing buffer without making it available to us to write into. I don't think there is an easy way to uninitialized-fill a vector unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants