From 069ba0d81d3e74204b20bf6505d93d4e5200eef2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 11 Jun 2010 11:04:45 +0000 Subject: [PATCH] use after free --- src/fs/fs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fs/fs.c b/src/fs/fs.c index 4107e137a..e4e81635a 100644 --- a/src/fs/fs.c +++ b/src/fs/fs.c @@ -1271,12 +1271,14 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation * fi) if (GNUNET_OK != GNUNET_BIO_write_close (wh)) { + wh = NULL; GNUNET_break (0); goto cleanup; } return; /* done! */ cleanup: - (void) GNUNET_BIO_write_close (wh); + if (wh != NULL) + (void) GNUNET_BIO_write_close (wh); GNUNET_free_non_null (chks); GNUNET_free_non_null (ksks); fn = get_serialization_file_name (fi->h, GNUNET_FS_SYNC_PATH_FILE_INFO, fi->serialization); -- 2.25.1