bindings: python: fix a use-after-free bug
authorIker Pedrosa <ikerpedrosam@gmail.com>
Mon, 29 Jul 2024 10:57:16 +0000 (12:57 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 31 Jul 2024 08:46:36 +0000 (10:46 +0200)
commitc497e29ca1f88963c525351e60af23ed896a2b8c
tree4c9f2cc2dce24cc78928bcda5ef7e83e1622c62f
parent0c7ec9ee42912db00850c7570bbfd5325339da13
bindings: python: fix a use-after-free bug

`req_cfg` variable is freed and then used, which would generate an
error. Avoid this problem by freeing when the variable will no longer be
used.

Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/3d8b12dd60eec59d4184c0bcc7d575b4eccbc22c.1722250385.git.ikerpedrosam@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
bindings/python/gpiod/ext/chip.c