diff --git a/g10/compress.c b/g10/compress.c index 4598affff..aad8a751c 100644 --- a/g10/compress.c +++ b/g10/compress.c @@ -313,15 +313,18 @@ int handle_compressed( void *procctx, PKT_compressed *cd, int (*callback)(IOBUF, void *), void *passthru ) { - compress_filter_context_t *cfx; int rc; if(check_compress_algo(cd->algorithm)) return G10ERR_COMPR_ALGO; - cfx = xmalloc_clear (sizeof *cfx); - cfx->release = release_context; - cfx->algo = cd->algorithm; - push_compress_filter(cd->buf,cfx,cd->algorithm); + if(cd->algorithm) { + compress_filter_context_t *cfx; + + cfx = xmalloc_clear (sizeof *cfx); + cfx->release = release_context; + cfx->algo = cd->algorithm; + push_compress_filter(cd->buf,cfx,cd->algorithm); + } if( callback ) rc = callback(cd->buf, passthru ); else