[PATCH 06/32] tools:iio:generic_buffer: add check before free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The string trigger_name only gets dynamically allocated, if
!notrigger == true. Therefore add this check before freeing the string.

Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx>
---
 tools/iio/generic_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c
index 0410948..51ae3df 100644
--- a/tools/iio/generic_buffer.c
+++ b/tools/iio/generic_buffer.c
@@ -358,7 +358,7 @@ error_free_channels:
 	}
 	free(channels);
 error_free_triggername:
-	if (datardytrigger)
+	if (datardytrigger && !notrigger)
 		free(trigger_name);
 error_free_dev_dir_name:
 	free(dev_dir_name);
-- 
2.3.6

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux