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:
647cc34
)
tests: fix a memory leak in exit path
author
Bartosz Golaszewski
<bgolaszewski@baylibre.com>
Sat, 6 Jul 2019 17:31:36 +0000
(19:31 +0200)
committer
Bartosz Golaszewski
<bgolaszewski@baylibre.com>
Sat, 6 Jul 2019 17:31:36 +0000
(19:31 +0200)
When exiting normally we free all allocated resources (mostly to keep
valgrind quiet). The toolpath string is not being freed and pops up in
valgrind's "still reachable" category of leaks. Free this memory too
in the atexit() cleanup callback.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
tests/gpiod-test.c
patch
|
blob
|
history
diff --git
a/tests/gpiod-test.c
b/tests/gpiod-test.c
index 621d837b86d13f0bf84b7d98dc684dfc3cb96041..82e23ea11dc63a83f693edb024cf78f186ff6e42 100644
(file)
--- a/
tests/gpiod-test.c
+++ b/
tests/gpiod-test.c
@@
-311,6
+311,8
@@
static void cleanup_func(void)
msg("cleaning up");
free(globals.pipebuf);
+ if (globals.toolpath)
+ free(globals.toolpath);
gpio_mockup_unref(globals.mockup);
}