From 4171b49b44b02f4611aac78548712222a1edd456 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Sun, 15 Feb 2015 23:30:56 +0100 Subject: [PATCH] Update nbio_stdio.c --- nbio/nbio_stdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbio/nbio_stdio.c b/nbio/nbio_stdio.c index 989dea766b..c3e8bbd2f2 100644 --- a/nbio/nbio_stdio.c +++ b/nbio/nbio_stdio.c @@ -45,7 +45,7 @@ struct nbio_t* nbio_open(const char * filename, enum nbio_mode_t mode) handle->data = malloc(handle->len); - if (!handle->data) + if (handle->len && !handle->data) { free(handle); fclose(f);