From f43c1c67383572d97d8e8918c92783af7fc3ce59 Mon Sep 17 00:00:00 2001 From: woojin Date: Wed, 24 Apr 2013 04:19:27 +0900 Subject: [PATCH] fix prevent violation Change-Id: Ib828bd989b8246fb56023c41863a1b353ed64602 --- probe_file/da_io_stdc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/probe_file/da_io_stdc.c b/probe_file/da_io_stdc.c index 0d2533a..aa673b9 100644 --- a/probe_file/da_io_stdc.c +++ b/probe_file/da_io_stdc.c @@ -107,7 +107,9 @@ int fclose(FILE* stream) bfiltering = false; PRE_PROBEBLOCK_BEGIN(); GET_FD_FROM_FILEP(stream); - _fstatret = fstat(_fd, &_statbuf); + if(_fd != -1) { + _fstatret = fstat(_fd, &_statbuf); + } PRE_PROBEBLOCK_END(); ret = fclosep(stream); -- 2.7.4