From f56f6175de1a5c21966369c1b1624a3a42106000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=AE=E5=AD=90=E7=9A=84=E9=AD=82?= Date: Sun, 8 Nov 2015 20:41:00 +0800 Subject: [PATCH] fix the may comming bug --- binding/c/ip2region.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/binding/c/ip2region.c b/binding/c/ip2region.c index 73bc909..67931b3 100644 --- a/binding/c/ip2region.c +++ b/binding/c/ip2region.c @@ -61,7 +61,11 @@ IP2R_API uint_t ip2region_destroy(ip2region_t ip2rObj) ip2rObj->HeaderPtr = NULL; //close the db file resource - fclose(ip2rObj->dbHandler); + if ( ip2rObj->dbHandler != NULL ) + { + fclose(ip2rObj->dbHandler); + ip2rObj->dbHandler = NULL; + } return 1; }