[PR #1635] using unique_ptr to solve the crash issue. #1794

Open
opened 2026-02-28 02:13:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/tzapu/WiFiManager/pull/1635
Author: @zenz
Created: 7/7/2023
Status: 🔄 Open

Base: masterHead: master


📝 Commits (6)

📊 Changes

9 files changed (+3749 additions, -3108 deletions)

View changed files

📝 README.md (+5 -8)
📝 WiFiManager.cpp (+2665 -2042)
📝 WiFiManager.h (+544 -531)
📝 examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino (+49 -25)
📝 library.json (+1 -1)
📝 library.properties (+1 -1)
📝 wm_consts_en.h (+82 -94)
📝 wm_strings_en.h (+201 -203)
📝 wm_strings_es.h (+201 -203)

📄 Description

on ESP8266, while using
delete[] _value;
_value = new char[.....]
will cause a crash with init WiFiManagerParameter.
so try to use unique_ptr.reset to solve the issue. unique_ptr variable should be auto release during the destructor.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/tzapu/WiFiManager/pull/1635 **Author:** [@zenz](https://github.com/zenz) **Created:** 7/7/2023 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (6) - [`3c8c26c`](https://github.com/tzapu/WiFiManager/commit/3c8c26ce1a62df65e6cc33006bd6860a6901de1e) Fix memory issue here. - [`815c10f`](https://github.com/tzapu/WiFiManager/commit/815c10f77f66fa7f1829449a67a4781780843307) using unique_ptr - [`6cac6a6`](https://github.com/tzapu/WiFiManager/commit/6cac6a6678b12cffd0d3fa1e0c850b9307c7f272) unique_ptr should auto release memory; - [`fd6d9fc`](https://github.com/tzapu/WiFiManager/commit/fd6d9fcc9a3525627cdfb0cd1a4ea190f981b9eb) sorry, forgot to modify the getValue - [`54f3d24`](https://github.com/tzapu/WiFiManager/commit/54f3d2467a8b933682a3d2a0bdc66411ab9f62f1) 我自己的修改 - [`754d4da`](https://github.com/tzapu/WiFiManager/commit/754d4daae0224f90dc0dde196362bbc39cc72ecc) 防止过度跳转 ### 📊 Changes **9 files changed** (+3749 additions, -3108 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+5 -8) 📝 `WiFiManager.cpp` (+2665 -2042) 📝 `WiFiManager.h` (+544 -531) 📝 `examples/Super/OnDemandConfigPortal/OnDemandConfigPortal.ino` (+49 -25) 📝 `library.json` (+1 -1) 📝 `library.properties` (+1 -1) 📝 `wm_consts_en.h` (+82 -94) 📝 `wm_strings_en.h` (+201 -203) 📝 `wm_strings_es.h` (+201 -203) </details> ### 📄 Description on ESP8266, while using delete[] _value; _value = new char[.....] will cause a crash with init WiFiManagerParameter. so try to use unique_ptr.reset to solve the issue. unique_ptr variable should be auto release during the destructor. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1794
No description provided.