Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unreachable code in thumbhash_encoder_create (#129) #130

Conversation

skidder
Copy link
Contributor

@skidder skidder commented Aug 10, 2023

Fixes #129

@@ -16,9 +16,6 @@ struct thumbhash_encoder_struct {
thumbhash_encoder thumbhash_encoder_create(void* buf, size_t buf_len)
{
thumbhash_encoder e = new struct thumbhash_encoder_struct();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skidder wouldn't it be better to enclose this into a try-catch block? If the std::bad_alloc is encountered, we should catch it and return NULL since the function is already designed in a way that it returns NULL when new fails

@skidder
Copy link
Contributor Author

skidder commented Nov 25, 2024

Closing due to inactivity.

@skidder skidder closed this Nov 25, 2024
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.

Unreachable code in thumbhash_encoder_create function
2 participants