summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2015-09-07 13:30:48 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2015-09-07 13:30:48 +0200
commit342db1ee38eca08fdc0d7cadd7ee3692d538afeb (patch)
tree5495ba599424c53ae4df4cf23dfc26b9b5c7950d /src/examples
parente08a7d7c9d934b023c461b31e5942800174bd2a6 (diff)
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
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/ecore/ecore_buffer_provider_example.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/examples/ecore/ecore_buffer_provider_example.c b/src/examples/ecore/ecore_buffer_provider_example.c
index 112854b4dc..5d1d5b01ff 100644
--- a/src/examples/ecore/ecore_buffer_provider_example.c
+++ b/src/examples/ecore/ecore_buffer_provider_example.c
@@ -246,7 +246,7 @@ main(void)
246 246
247 pd = (Provider_Data *)calloc(sizeof(Provider_Data), 1); 247 pd = (Provider_Data *)calloc(sizeof(Provider_Data), 1);
248 248
249 if (!(pd->provider = ecore_buffer_provider_new(name))) 249 if (!pd || !(pd->provider = ecore_buffer_provider_new(name)))
250 { 250 {
251 LOG("Failed to create provider"); 251 LOG("Failed to create provider");
252 goto shutdown; 252 goto shutdown;
@@ -267,7 +267,7 @@ shutdown:
267 ecore_buffer_free(b); 267 ecore_buffer_free(b);
268 } 268 }
269 if (pd->provider) ecore_buffer_provider_free(pd->provider); 269 if (pd->provider) ecore_buffer_provider_free(pd->provider);
270 if (pd) free(pd); 270 free(pd);
271 271
272 shutdown_all(); 272 shutdown_all();
273 return 0; 273 return 0;