   if (err == MP_OKAY) {
       w = (mp_int*)XMALLOC(sizeof(mp_int), key->heap, DYNAMIC_TYPE_ECC);
       if (w == NULL)
           err = MEMORY_E;
   }
   if (err == MP_OKAY) {
       w = (mp_int*)XMALLOC(sizeof(mp_int), key->heap, DYNAMIC_TYPE_ECC);
       if (w == NULL)
           err = MEMORY_E;
   }