Browse Source

change: http,在清理变量的末尾,为内存区域填0,如果有问题就会快速死机

Wendal Chen 3 months ago
parent
commit
63a5193ef5
1 changed files with 1 additions and 0 deletions
  1. 1 0
      components/network/libhttp/luat_http_client.c

+ 1 - 0
components/network/libhttp/luat_http_client.c

@@ -110,6 +110,7 @@ int http_close(luat_http_ctrl_t *http_ctrl){
 		luat_heap_free(http_ctrl->req_auth);
 		luat_heap_free(http_ctrl->req_auth);
 		http_ctrl->req_auth = NULL;
 		http_ctrl->req_auth = NULL;
 	}
 	}
+	memset(http_ctrl, 0, sizeof(luat_http_ctrl_t));
 	luat_heap_free(http_ctrl);
 	luat_heap_free(http_ctrl);
 	return 0;
 	return 0;
 }
 }