mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
g10: Push compress filter only if compressed.
* g10/compress.c (handle_compressed): Fix memory leak. -- (backport from STABLE-BRANCH-2-2 commit: c31abf84659dbda5503dd9f3aa3449520bcd1b84) All other calls of push_compress_filter checks ALGO, so, do it here, too. GnuPG-bug-id: 3898 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
097c593158
commit
0f8fd95ab3
@ -313,15 +313,18 @@ int
|
|||||||
handle_compressed( void *procctx, PKT_compressed *cd,
|
handle_compressed( void *procctx, PKT_compressed *cd,
|
||||||
int (*callback)(IOBUF, void *), void *passthru )
|
int (*callback)(IOBUF, void *), void *passthru )
|
||||||
{
|
{
|
||||||
compress_filter_context_t *cfx;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if(check_compress_algo(cd->algorithm))
|
if(check_compress_algo(cd->algorithm))
|
||||||
return G10ERR_COMPR_ALGO;
|
return G10ERR_COMPR_ALGO;
|
||||||
cfx = xmalloc_clear (sizeof *cfx);
|
if(cd->algorithm) {
|
||||||
cfx->release = release_context;
|
compress_filter_context_t *cfx;
|
||||||
cfx->algo = cd->algorithm;
|
|
||||||
push_compress_filter(cd->buf,cfx,cd->algorithm);
|
cfx = xmalloc_clear (sizeof *cfx);
|
||||||
|
cfx->release = release_context;
|
||||||
|
cfx->algo = cd->algorithm;
|
||||||
|
push_compress_filter(cd->buf,cfx,cd->algorithm);
|
||||||
|
}
|
||||||
if( callback )
|
if( callback )
|
||||||
rc = callback(cd->buf, passthru );
|
rc = callback(cd->buf, passthru );
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user