aboutsummaryrefslogtreecommitdiff
path: root/src/util/bio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/bio.c')
-rw-r--r--src/util/bio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/bio.c b/src/util/bio.c
index 059638ff1..3fc7d05e6 100644
--- a/src/util/bio.c
+++ b/src/util/bio.c
@@ -79,10 +79,16 @@ GNUNET_BIO_read_open (const char *fn)
79int 79int
80GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg) 80GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg)
81{ 81{
82 *emsg = h->emsg; 82 int err;
83
84 err = (NULL == h->emsg) ? GNUNET_OK : GNUNET_SYSERR;
85 if (emsg != NULL)
86 *emsg = h->emsg;
87 else
88 GNUNET_free_non_null (h->emsg);
83 GNUNET_DISK_file_close (h->fd); 89 GNUNET_DISK_file_close (h->fd);
84 GNUNET_free (h); 90 GNUNET_free (h);
85 return (NULL == *emsg) ? GNUNET_OK : GNUNET_SYSERR; 91 return err;
86} 92}
87 93
88 94