forked from enlightenment/efl
ecore_example: Fixing NULL deference.
Summary: pd was dereferenced and then checked for NULL. If it was NULL, the program would crash much before. So fixed that. Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: cedric, stefan_schmidt Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3031
This commit is contained in:
parent
e08a7d7c9d
commit
342db1ee38
|
@ -246,7 +246,7 @@ main(void)
|
|||
|
||||
pd = (Provider_Data *)calloc(sizeof(Provider_Data), 1);
|
||||
|
||||
if (!(pd->provider = ecore_buffer_provider_new(name)))
|
||||
if (!pd || !(pd->provider = ecore_buffer_provider_new(name)))
|
||||
{
|
||||
LOG("Failed to create provider");
|
||||
goto shutdown;
|
||||
|
@ -267,7 +267,7 @@ shutdown:
|
|||
ecore_buffer_free(b);
|
||||
}
|
||||
if (pd->provider) ecore_buffer_provider_free(pd->provider);
|
||||
if (pd) free(pd);
|
||||
free(pd);
|
||||
|
||||
shutdown_all();
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue