updates.
[runtime.git] / lib / silccrypt / silchmac.c
index 454c175fedeef80ee45accb1799dbecda89588e6..00fd15ecb4d252aafd8ba7fbe1d9923f74ea9117 100644 (file)
@@ -123,6 +123,8 @@ bool silc_hmac_alloc(char *name, SilcHash hash, SilcHmac *new_hmac)
 
     if (!silc_hash_alloc(hname, &hash)) {
       silc_free(tmp);
+      silc_free(*new_hmac);
+      *new_hmac = NULL;
       return FALSE;
     }
 
@@ -142,6 +144,8 @@ bool silc_hmac_alloc(char *name, SilcHash hash, SilcHmac *new_hmac)
     }
   }
 
+  silc_free(*new_hmac);
+  *new_hmac = NULL;
   return FALSE;
 }