Use calloc instead of malloc, so all the pointers are already NULL. 62/8862/1
authorRafael Antognolli <rafael.antognolli@intel.com>
Thu, 29 Aug 2013 17:07:52 +0000 (14:07 -0300)
committerRafael Antognolli <rafael.antognolli@intel.com>
Thu, 29 Aug 2013 17:07:52 +0000 (14:07 -0300)
We check for NULL pointers in case the toolbar is disabled by command
line.

Tools/MiniBrowser/efl/main.c

index 849c11f..699390a 100755 (executable)
@@ -414,7 +414,7 @@ create_toolbar_button(Evas_Object *window, const char *icon_name)
 
 static Browser_Window *window_create(const char *url)
 {
-    Browser_Window *app_data = malloc(sizeof(Browser_Window));
+    Browser_Window *app_data = calloc(1, sizeof(Browser_Window));
     if (!app_data) {
         info("ERROR: could not create browser window.\n");
         return NULL;