Skip to content

Commit

Permalink
Don't crash if an error occurs when we fail to create a context
Browse files Browse the repository at this point in the history
Context::~Context calls free on p_devices and p_properties, but these
two members may not be initialized if we fail somewhere in the
constructor, return, and then get deleted by clCreateContext.
  • Loading branch information
steckdenis committed May 24, 2011
1 parent 7af06c2 commit 0416a57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/context.cpp
Expand Up @@ -124,7 +124,8 @@ Context::~Context()
if (p_properties)
free((void *)p_properties);

free((void *)p_devices);
if (p_devices)
free((void *)p_devices);
}

void Context::reference()
Expand Down

0 comments on commit 0416a57

Please sign in to comment.