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:
4348a31
)
tests: fix a potential segfault
author
Bartosz Golaszewski
<bartekgola@gmail.com>
Mon, 12 Jun 2017 09:01:52 +0000
(11:01 +0200)
committer
Bartosz Golaszewski
<bartekgola@gmail.com>
Mon, 12 Jun 2017 09:01:52 +0000
(11:01 +0200)
A string passed to test_free_str() must be allocated by malloc() or
NULL, so we need to initialize ptrn.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
tests/tests-gpioinfo.c
patch
|
blob
|
history
diff --git
a/tests/tests-gpioinfo.c
b/tests/tests-gpioinfo.c
index e2b7419361aad13a658b826772d8c5b2fa790b6d..ff4a509e563dcc15c602d5a6abf06043532abc4e 100644
(file)
--- a/
tests/tests-gpioinfo.c
+++ b/
tests/tests-gpioinfo.c
@@
-34,7
+34,7
@@
TEST_DEFINE(gpioinfo_simple,
static void gpioinfo_one_exported(void)
{
TEST_CLEANUP(test_close_chip) struct gpiod_chip *chip = NULL;
- TEST_CLEANUP(test_free_str) char *ptrn;
+ TEST_CLEANUP(test_free_str) char *ptrn
= NULL
;
struct gpiod_line *line;
int rv;