[Feature][ZXW-41] merged 0601 version

Change-Id: I667af6bb09d65581d455b73f8984c160b2c67ad8
diff --git a/ap/lib/libatext/ext_wdt_func.c b/ap/lib/libatext/ext_wdt_func.c
index db6806d..d0df9f6 100644
--- a/ap/lib/libatext/ext_wdt_func.c
+++ b/ap/lib/libatext/ext_wdt_func.c
@@ -244,11 +244,13 @@
 	ret=ioctl(fd, RPMSG_SET_INT_FLAG, NULL);

 	if(ret<0){

 	 	at_print(AT_DEBUG,"cap add  ioctl FAIL\n");

+		close(fd);

 		return AT_END;	

 	}		

 	ret=write(fd, &ctx, 4);

 	if(ret<0){

 	 	at_print(AT_DEBUG,"cap add  write FAIL\n");

+		close(fd);

 		return AT_END;	

 	}

 	

@@ -278,11 +280,13 @@
 	ret=ioctl(fd, RPMSG_SET_INT_FLAG, NULL);

 	if(ret<0){

 	 	at_print(AT_DEBUG,"cap add  ioctl FAIL\n");

+		close(fd);

 		return AT_END;	

 	}		

 	ret=write(fd, &ctx, 4);

 	if(ret<0){

 	 	at_print(AT_DEBUG,"cap add  write FAIL\n");

+		close(fd);

 		return AT_END;	

 	}