aboutsummaryrefslogtreecommitdiffstats
path: root/g10/mdfilter.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/mdfilter.c')
-rw-r--r--g10/mdfilter.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/g10/mdfilter.c b/g10/mdfilter.c
index b6cd86110..5a77c9012 100644
--- a/g10/mdfilter.c
+++ b/g10/mdfilter.c
@@ -45,7 +45,7 @@ md_filter( void *opaque, int control,
int i, c, rc=0;
if( control == IOBUFCTRL_UNDERFLOW ) {
- if( size > mfx->maxbuf_size )
+ if( mfx->maxbuf_size && size > mfx->maxbuf_size )
size = mfx->maxbuf_size;
for(i=0; i < size; i++ ) {
if( (c = iobuf_get(a)) == -1 )
@@ -68,3 +68,16 @@ md_filter( void *opaque, int control,
return rc;
}
+
+void
+free_md_filter_context( md_filter_context_t *mfx )
+{
+ if( mfx->md5 )
+ md5_close(mfx->md5);
+ mfx->md5 = NULL;
+ if( mfx->rmd160 )
+ rmd160_close(mfx->rmd160);
+ mfx->rmd160 = NULL;
+ mfx->maxbuf_size = 0;
+}
+