aboutsummaryrefslogtreecommitdiffstats
path: root/util/iobuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/iobuf.c')
-rw-r--r--util/iobuf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/iobuf.c b/util/iobuf.c
index 471653877..dd1a2b181 100644
--- a/util/iobuf.c
+++ b/util/iobuf.c
@@ -905,7 +905,10 @@ iobuf_close ( IOBUF a )
a->chain, NULL, &dummy_len)) )
log_error("IOBUFCTRL_FREE failed on close: %s\n", g10_errstr(rc) );
m_free(a->real_fname);
- m_free(a->d.buf);
+ if (a->d.buf) {
+ memset (a->d.buf, 0, a->d.size); /* erase the buffer */
+ m_free(a->d.buf);
+ }
m_free(a);
}
return rc;