From: Christian Grothoff Date: Fri, 11 Jun 2010 11:04:45 +0000 (+0000) Subject: use after free X-Git-Tag: initial-import-from-subversion-38251~21421 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=069ba0d81d3e74204b20bf6505d93d4e5200eef2;p=oweals%2Fgnunet.git use after free --- 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);