]> git.cryptolib.org Git - arm-crypto-lib.git/blobdiff - hfal/hfal-hmac.c
some white space editing
[arm-crypto-lib.git] / hfal / hfal-hmac.c
index 6f5fbf9bc7c32ae546b9f4fce960ffca70a2d43e..01a6409356d4284a9cd42b92f7ba0b9525b63fe4 100644 (file)
@@ -38,13 +38,13 @@ uint8_t hfal_hmac_init(const hfdesc_t* hash_descriptor,
        ctx->desc   = hash_descriptor;
        ctx->ctx    = malloc(hash_descriptor->ctxsize_B);
        ctx->finctx = malloc(hash_descriptor->ctxsize_B);
-       if(ctx->ctx==NULL && ctx->finctx==NULL)
+       if(ctx->ctx == NULL && ctx->finctx == NULL)
                return 3;
-       if(ctx->finctx==NULL){
+       if(ctx->finctx == NULL){
                free(ctx->ctx);
                return 2;
        }
-       if(ctx->ctx==NULL){
+       if(ctx->ctx == NULL){
                free(ctx->finctx);
                return 1;
        }               
@@ -78,6 +78,7 @@ uint8_t hfal_hmac_ctxcopy(hfhmacgen_ctx_t* dest, hfhmacgen_ctx_t* src){
        memcpy(dest->ctx, src->ctx, dest->desc->ctxsize_B);
        dest->finctx = malloc(dest->desc->ctxsize_B);
        if(dest->finctx == NULL){
+               free(dest->ctx);
                return 1;
        }
        memcpy(dest->finctx, src->finctx, dest->desc->ctxsize_B);