mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
common: Fix memory leak.
* common/iobuf.c (iobuf_set_partial_body_length_mode): Only create context if necessary. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
9037c23979
commit
d2d19063d3
@ -2530,9 +2530,6 @@ iobuf_get_fname_nonnull (iobuf_t a)
|
||||
void
|
||||
iobuf_set_partial_body_length_mode (iobuf_t a, size_t len)
|
||||
{
|
||||
block_filter_ctx_t *ctx = xcalloc (1, sizeof *ctx);
|
||||
|
||||
ctx->use = a->use;
|
||||
if (!len)
|
||||
/* Disable partial body length mode. */
|
||||
{
|
||||
@ -2546,6 +2543,8 @@ iobuf_set_partial_body_length_mode (iobuf_t a, size_t len)
|
||||
else
|
||||
/* Enabled partial body length mode. */
|
||||
{
|
||||
block_filter_ctx_t *ctx = xcalloc (1, sizeof *ctx);
|
||||
ctx->use = a->use;
|
||||
ctx->partial = 1;
|
||||
ctx->size = 0;
|
||||
ctx->first_c = len;
|
||||
|
Loading…
x
Reference in New Issue
Block a user