* ecore_con_info: Reduce malloc and memset.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 30 Nov 2009 12:25:02 +0000 (12:25 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 30 Nov 2009 12:25:02 +0000 (12:25 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@44050 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_con/ecore_con_info.c

index 837a097..eda50ef 100644 (file)
@@ -214,10 +214,9 @@ ecore_con_info_get(Ecore_Con_Server *svr,
              canonname_len = strlen(result->ai_canonname) + 1;
            tosend_len = sizeof(Ecore_Con_Info) + result->ai_addrlen + canonname_len;
 
-           if (!(tosend = malloc(tosend_len)))
+           if (!(tosend = alloca(tosend_len)))
              goto on_error;
 
-           memset(tosend, 0, tosend_len);
            container = (Ecore_Con_Info *)tosend;
 
            container->size = tosend_len;
@@ -234,8 +233,6 @@ ecore_con_info_get(Ecore_Con_Server *svr,
                memcpy(container->service, sbuf, sizeof(container->service));
              }
            err = write(fd[1], tosend, tosend_len);
-
-           free(tosend);
          }
 
 on_error: