summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gnutls_x509.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c
index 32f19e1ef4..3186b76785 100644
--- a/lib/gnutls_x509.c
+++ b/lib/gnutls_x509.c
@@ -539,8 +539,13 @@ typedef struct {
inline static void _strfile_free( strfile *x)
{
- if (x->mmaped) return;
-
+#ifdef HAVE_MMAP
+ if (x->mmaped) {
+ munmap( x->data, x->size);
+ return;
+ }
+#endif
+
gnutls_free( x->data);
x->data = NULL;
}
@@ -575,6 +580,7 @@ strfile _gnutls_file_to_str( const char * file)
ret.data = tmp;
ret.size = tot_size;
+ close(fd1);
return ret;
}
#endif