Index: /branches/prototype-v0/zoo-project/zoo-kernel/service.c
===================================================================
--- /branches/prototype-v0/zoo-project/zoo-kernel/service.c	(revision 880)
+++ /branches/prototype-v0/zoo-project/zoo-kernel/service.c	(revision 881)
@@ -452,7 +452,25 @@
 }
 
+
+/**
+ * Allocate memory for a service.
+ * Require to call free after calling this function.
+ *
+ * @return the service
+ */
+service* createService(){
+  service *s1 = (service *) malloc (SERVICE_SIZE);
+  s1->name=NULL;
+  s1->content=NULL;
+  s1->metadata=NULL;
+  s1->additional_parameters=NULL;
+  s1->inputs=NULL;
+  s1->outputs=NULL;
+  return s1;
+}
+
 /**
  * Free allocated memory of a service.
- * Require to call free on e after calling this function.
+ * Require to be invoked for every createService call.
  *
  * @param s the service to free
Index: /branches/prototype-v0/zoo-project/zoo-kernel/service.h
===================================================================
--- /branches/prototype-v0/zoo-project/zoo-kernel/service.h	(revision 880)
+++ /branches/prototype-v0/zoo-project/zoo-kernel/service.h	(revision 881)
@@ -296,4 +296,5 @@
   ZOO_DLL_EXPORT void freeElements(elements**);
   ZOO_DLL_EXPORT void setServiceName(service**,char*);
+  ZOO_DLL_EXPORT service* createService();
   ZOO_DLL_EXPORT void freeService(service**);
   ZOO_DLL_EXPORT void addToMap(map*,const char*,const char*);
Index: /branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- /branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 880)
+++ /branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 881)
@@ -337,5 +337,5 @@
             map* import = getMapFromMaps (m, IMPORTSERVICE, tmpsn);
             if (import == NULL || import->value == NULL || zoo_path_compare(tmps1, import->value) != 0 ) { // service is not in [include] block 
-              service *s1 = (service *) malloc (SERVICE_SIZE);
+              service *s1 = createService();
               if (s1 == NULL)
                 {
@@ -1523,5 +1523,5 @@
 			if(s2==NULL){
 #endif
-			  s1 = (service *) malloc (SERVICE_SIZE);
+			  s1 = createService();
 			  t = readServiceFile (m, import->value, &s1, import->name);
                 
@@ -1586,5 +1586,5 @@
 			 #endif
 			*/
-			s1 = (service *) malloc (SERVICE_SIZE);
+			s1 = createService();
 			t = readServiceFile (m, buff1, &s1, tmpMapI->value);
 			if (t < 0)
@@ -1671,5 +1671,5 @@
 				  snprintf (buff1, 1024, "%s/%s", conf_dir,
 					    dp->d_name);
-				  s1 = (service *) malloc (SERVICE_SIZE);
+				  s1 = createService();
 				  if (s1 == NULL)
 				    {
@@ -1927,5 +1927,5 @@
   }else /* Not found in MetaDB */{
 #endif
-    s1 = (service *) malloc (SERVICE_SIZE);
+    s1 = createService();
     if (s1 == NULL)
       {
