projects
/
qemu-gpiodev
/
libgpiod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
583cf82
)
tests: iter: free non-mockup GPIO chips
author
Bartosz Golaszewski
<bgolaszewski@baylibre.com>
Thu, 11 Jul 2019 15:24:28 +0000
(17:24 +0200)
committer
Bartosz Golaszewski
<bgolaszewski@baylibre.com>
Thu, 11 Jul 2019 15:24:28 +0000
(17:24 +0200)
When using gpiod_foreach_chip_noclose() we need to close any non-mockup
GPIO chip that may be present in the system. Otherwise we'll be leaking
memory.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
tests/tests-iter.c
patch
|
blob
|
history
diff --git
a/tests/tests-iter.c
b/tests/tests-iter.c
index f4aff42b481d73a98d263c8c7d3757662ed84d7e..de71efdb874b2540873df741ef4188228eaedcc2 100644
(file)
--- a/
tests/tests-iter.c
+++ b/
tests/tests-iter.c
@@
-64,6
+64,8
@@
static void chip_iter_noclose(void)
"gpio-mockup-C") == 0) {
C = true;
chipC = chip;
+ } else {
+ gpiod_chip_close(chip);
}
}