Imported Upstream version 2.1.14
[platform/upstream/gpg2.git] / g10 / compress.c
index 0a6e09d..c34beec 100644 (file)
@@ -29,7 +29,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <assert.h>
 #include <errno.h>
 #ifdef HAVE_ZIP
 # include <zlib.h>
@@ -288,7 +287,7 @@ compress_filter( void *opaque, int control,
           zfx->release (zfx);
     }
     else if( control == IOBUFCTRL_DESC )
-       *(char**)buf = "compress_filter";
+        mem2str (buf, "compress_filter", *ret_len);
     return rc;
 }
 #endif /*HAVE_ZIP*/
@@ -296,6 +295,10 @@ compress_filter( void *opaque, int control,
 static void
 release_context (compress_filter_context_t *ctx)
 {
+  xfree(ctx->inbuf);
+  ctx->inbuf = NULL;
+  xfree(ctx->outbuf);
+  ctx->outbuf = NULL;
   xfree (ctx);
 }
 
@@ -310,7 +313,7 @@ handle_compressed (ctrl_t ctrl, void *procctx, PKT_compressed *cd,
     int rc;
 
     if(check_compress_algo(cd->algorithm))
-      return G10ERR_COMPR_ALGO;
+      return GPG_ERR_COMPR_ALGO;
     cfx = xmalloc_clear (sizeof *cfx);
     cfx->release = release_context;
     cfx->algo = cd->algorithm;