From bd6066cb349a9b3a1b0d87b146ddaee06db31d10 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 10 Sep 2011 00:14:26 +0200 Subject: [PATCH] unix: fix readdir cleanup assertion --- src/unix/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/fs.c b/src/unix/fs.c index 85cfbfba..cab41064 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -85,7 +85,8 @@ void uv_fs_req_cleanup(uv_fs_t* req) { switch (req->fs_type) { case UV_FS_READDIR: - assert(req->ptr); + assert((req->result == -1 && req->ptr == NULL) + || (req->result >= 0 && req->ptr != NULL)); free(req->ptr); req->ptr = NULL; break;