diff --git a/control/descriptor.c b/control/descriptor.c
index 2459329895893f8f9435f4433db6c35df3c1ba83..6cf9be5485208a53b3dadae2c797d9fb6087b742 100644
--- a/control/descriptor.c
+++ b/control/descriptor.c
@@ -430,6 +430,7 @@ int MORSE_Desc_Create(MORSE_desc_t **descptr, void *mat, MORSE_enum dtyp, int mb
 
         if ((desc->mat = RUNTIME_malloc(size)) == NULL) {
             morse_error("MORSE_Desc_Create", "malloc() failed");
+            free(desc);
             return MORSE_ERR_OUT_OF_RESOURCES;
         }
         desc->use_mat      = 1;
diff --git a/control/workspace.c b/control/workspace.c
index 931577f2ae3e8d1b7ccfd67e20325064beb8343e..e5c04088cddcfd5b51570f63807ba08a72d1ed46 100644
--- a/control/workspace.c
+++ b/control/workspace.c
@@ -142,7 +142,7 @@ int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **des
     ln = NB * NT;
 
     size = (size_t)(chameleon_min(MT, NT) * NB * NT * sizeof(int));
-    if (size <= 0) {
+    if (size == 0) {
         *IPIV = NULL;
         return MORSE_SUCCESS;
     }
diff --git a/runtime/parsec/control/runtime_descriptor.c b/runtime/parsec/control/runtime_descriptor.c
index 8f01af0a5b5de765c517f003be8204a080903302..12ac813e8d4f84b08cb2417c1ec0f4334f60add9 100644
--- a/runtime/parsec/control/runtime_descriptor.c
+++ b/runtime/parsec/control/runtime_descriptor.c
@@ -188,7 +188,8 @@ morse_parsec_key_to_string(parsec_data_collection_t *data_collection, parsec_dat
     res = snprintf(buffer, buffer_size, "(%d, %d)", m, n);
     if (res < 0)
     {
-        printf("error in key_to_string for tile (%u, %u) key: %u\n", m, n, datakey);
+        printf("error in key_to_string for tile (%u, %u) key: %u\n",
+               (unsigned int)m, (unsigned int)n, datakey);
     }
     return res;
 }
diff --git a/runtime/starpu/control/runtime_profiling.c b/runtime/starpu/control/runtime_profiling.c
index 9c2d395a9d6bc591859b981ae9cdd3766b50a37e..787ae481d349b08b677f0d588710e6a219f8cedc 100644
--- a/runtime/starpu/control/runtime_profiling.c
+++ b/runtime/starpu/control/runtime_profiling.c
@@ -25,10 +25,10 @@
 #endif
 
 #ifdef CHAMELEON_ENABLE_PRUNING_STATS
-unsigned long RUNTIME_total_tasks;
-unsigned long RUNTIME_exec_tasks;
-unsigned long RUNTIME_comm_tasks;
-unsigned long RUNTIME_changed_tasks;
+unsigned long RUNTIME_total_tasks   = 0;
+unsigned long RUNTIME_exec_tasks    = 0;
+unsigned long RUNTIME_comm_tasks    = 0;
+unsigned long RUNTIME_changed_tasks = 0;
 #endif
 
 double RUNTIME_get_time(){
@@ -81,7 +81,8 @@ void RUNTIME_start_stats(){
 
 void RUNTIME_stop_stats(){
 #ifdef CHAMELEON_ENABLE_PRUNING_STATS
-    fprintf(stderr, "\ntasks: %u = exec: %u + comm: %u + changed: %u\n", RUNTIME_total_tasks, RUNTIME_exec_tasks, RUNTIME_comm_tasks, RUNTIME_changed_tasks);
+    fprintf( stderr, "\ntasks: %ul = exec: %ul + comm: %ul + changed: %ul\n",
+             RUNTIME_total_tasks, RUNTIME_exec_tasks, RUNTIME_comm_tasks, RUNTIME_changed_tasks );
 #endif
 }
 
diff --git a/testing/testing_zgemm.c b/testing/testing_zgemm.c
index e10da200aa8b7c11714304c45a7da55d55db7a1b..d676f871782b7395f781a2f11362029d6721f664 100644
--- a/testing/testing_zgemm.c
+++ b/testing/testing_zgemm.c
@@ -88,9 +88,9 @@ int testing_zgemm(int argc, char **argv)
     MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
 
     /* Check if unable to allocate memory */
-    if ( (!A) || (!B) || (!Cinit) || (!Cfinal) )
+    if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) )
     {
-        free(A); free(B);
+        free(A); free(B); free(C);
         free(Cinit); free(Cfinal);
         printf("Out of Memory \n ");
         return -2;
diff --git a/timing/timing.c b/timing/timing.c
index e928035c23f7bd9abe3a2999417930374db0eb28..36576de1789db2fa588b8f2da12a432d7bd04f74 100644
--- a/timing/timing.c
+++ b/timing/timing.c
@@ -170,7 +170,10 @@ Test(int64_t n, int *iparam) {
 
     if ( iparam[IPARAM_WARMUP] ) {
       int status = RunTest( iparam, dparam, &(t[0]));
-      if (status != MORSE_SUCCESS) return status;
+      if (status != MORSE_SUCCESS) {
+          free(t);
+          return status;
+      }
     }
 
     sumgf  = 0.0;