esp-iot-bridge icon indicating copy to clipboard operation
esp-iot-bridge copied to clipboard

warning: pointer 'item' used after 'free' [-Wuse-after-free] (AEGHB-331)

Open rinstrum-franz opened this issue 2 years ago • 2 comments

https://github.com/espressif/esp-iot-bridge/blob/a009f9a18e6e2ab095a9f88e9512f5e95927e04a/components/web_server/src/web_server.c#L292 https://github.com/espressif/esp-iot-bridge/blob/a009f9a18e6e2ab095a9f88e9512f5e95927e04a/components/web_server/src/web_server.c#L615

/home/franz/git/rin/rinGate/rinGate/components/web_server/src/web_server.c: In function 'stop_scan_filter':
/home/franz/git/rin/rinGate/rinGate/components/web_server/src/web_server.c:290:103: warning: pointer 'fail_item' used after 'free' [-Wuse-after-free]
  290 |         for (router_obj_t *fail_item = SLIST_FIRST(&s_router_fail_list); fail_item != NULL; fail_item = SLIST_NEXT(fail_item, next)) {
      |                                                                                                       ^
/home/franz/git/rin/rinGate/rinGate/components/web_server/src/web_server.c:292:13: note: call to 'free' here
  292 |             free(fail_item);
      |             ^~~~~~~~~~~~~~~
/home/franz/git/rin/rinGate/rinGate/components/web_server/src/web_server.c: In function 'esp_web_start_scan_filter':
/home/franz/git/rin/rinGate/rinGate/components/web_server/src/web_server.c:612:73: warning: pointer 'item' used after 'free' [-Wuse-after-free]
  612 |         for (item = SLIST_FIRST(&s_router_all_list); item != NULL; item = SLIST_NEXT(item, next)) {
      |                                                                         ^
/home/franz/git/rin/rinGate/rinGate/components/web_server/src/web_server.c:615:13: note: call to 'free' here
  615 |             free(item);
      |             ^~~~~~~~~~

rinstrum-franz avatar Aug 07 '23 09:08 rinstrum-franz

Hello, thank you for your feedback. Although these warnings do not affect the functionality, we will work on optimizing and resolving these warnings in the future.

tswen avatar Aug 08 '23 02:08 tswen

good

Am Di., 8. Aug. 2023 um 04:43 Uhr schrieb Tian Sen Wen < @.***>:

Hello, thank you for your feedback. Although these warnings do not affect the functionality, we will work on optimizing and resolving these warnings in the future.

— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-iot-bridge/issues/53#issuecomment-1668825523, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAGD6ENAVKW2KWRLEUKRPVDXUGRVZANCNFSM6AAAAAA3GXEZC4 . You are receiving this because you authored the thread.Message ID: @.***>

-- Diplom-Informatiker Franz Höpfinger e.K. Reibersdorf 16a 84419 Schwindegg

rinstrum-franz avatar Aug 08 '23 03:08 rinstrum-franz