tFree compression context on error - dedup - deduplicating backup program
 (HTM) git clone git://git.z3bra.org/dedup.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 222099ba0a96a08af154641dbab342243afd1807
 (DIR) parent 5dfe0aa3dbd6568360c5279fb540d5e4878c30c6
 (HTM) Author: sin <sin@2f30.org>
       Date:   Thu,  2 May 2019 13:48:11 +0100
       
       Free compression context on error
       
       Diffstat:
         M bcompress.c                         |       7 ++++---
       
       1 file changed, 4 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/bcompress.c b/bcompress.c
       t@@ -130,12 +130,13 @@ bcopen(struct bctx *bctx, char *path, int flags, int mode, struct bparam *bpar)
                        return -1;
                }
        
       -        if (strcmp(bpar->calgo, "none") == 0)
       +        if (strcmp(bpar->calgo, "none") == 0) {
                        cctx->type = CDNONETYPE;
       -        else if (strcmp(bpar->calgo, "snappy") == 0)
       +        } else if (strcmp(bpar->calgo, "snappy") == 0) {
                        cctx->type = CDSNAPPYTYPE;
       -        else {
       +        } else {
                        bops->close(bctx);
       +                free(cctx);
                        return -1;
                }
                return 0;