Merge "[BugFix][T106][bug-view-74][WIFI] If the customer switches the WIFI repeatedly, the WiFi will be stuck, and the AT can not be used"
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp
index 09160b7..5dc3fe5 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-autosuspend/lynq-autosuspend.cpp
@@ -88,7 +88,7 @@
 }
 static int Close(int fd)
 {
-    if (Close(fd) == -1)
+    if (close(fd) == -1)
     {
         LYINFLOG("Close error\n");
         return -1;
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-sim/lynq_sim.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-sim/lynq_sim.cpp
index d3a0891..1bfcb38 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-sim/lynq_sim.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-sim/lynq_sim.cpp
@@ -475,6 +475,7 @@
     *qser_state = p_info->applications[0].app_state;
 
     free(p_info);
+    delete p;
     return res;
 }
 #else
@@ -495,6 +496,7 @@
         return res;
     }
     p->readInt32(card_status);
+    delete p;
     return res;
 }
 #endif
@@ -516,6 +518,7 @@
     char * test = lynqStrdupReadString(*p);
     memcpy(buf, test, strlen(test));
     free(test);
+    delete p;
     return res;
 }
 
@@ -539,6 +542,7 @@
     char * test = lynqStrdupReadString(*p);
     memcpy(buf, test, strlen(test));
     free(test);
+    delete p;
     return res;
 }
 
@@ -555,6 +559,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
+    delete p;
     return res;
 }
 
@@ -574,6 +579,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
+    delete p;
     return res;
 }
 #else
@@ -592,6 +598,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
+    delete p;
     return res;
 }
 #endif
@@ -610,6 +617,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
+    delete p;
     return res;
 }
 
@@ -638,6 +646,7 @@
         }
         free(test);
     }
+    delete p;
     return res;
 }
 
@@ -655,6 +664,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
+    delete p;
     return res;
 }
 
@@ -680,6 +690,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
+    delete p;
     return res;
 }
 
@@ -703,6 +714,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
+    delete p;
     return res;
 }
 
@@ -784,6 +796,8 @@
     }
     char * test = lynqStrdupReadString(*p);
     memcpy(buf, test, strlen(test));
+    free(test);
+    delete p;
     return res;
 }
 
@@ -811,6 +825,7 @@
         num = parse_param(test, argv, buf);
         return num;
     }
+    delete p;
     return res;
 }
 #endif
@@ -835,6 +850,7 @@
     char * test = lynqStrdupReadString(*p);
     memcpy(buf, test, strlen(test));
     free(test);
+    delete p;
     return res;
 }
 
@@ -885,6 +901,7 @@
             free(resp[i]);
         }
     }
+    delete p;
     return i==2? 0:-1;
 
 }
@@ -943,6 +960,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
+    delete p;
     return res;
 }
 
@@ -972,6 +990,7 @@
     {
         RLOGD("function %s execute success\n", __FUNCTION__);
     }
+    delete p;
     return res;
 }
 #endif
@@ -997,6 +1016,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
+    delete p;
     return res;
 }
 
@@ -1086,6 +1106,7 @@
     char * test = lynqStrdupReadString(*p);
     memcpy(simResponse, test, strlen(test));
     free(test);
+    delete p;
     return res;
 }
 
@@ -1125,7 +1146,7 @@
         RLOGD("function %s execute error", __FUNCTION__);
         return res;
     }
-
+    delete p;
     return res;
 
 }