From: kibak.yoon Date: Tue, 2 Jan 2018 09:17:53 +0000 (+0900) Subject: pio: free the memory allocated by system_info_get_platform_string() X-Git-Tag: submit/tizen/20180103.062104~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=536ad7a2e101d3e3264565f0810cf27da990c5ae;p=platform%2Fcore%2Fapi%2Fperipheral-io.git pio: free the memory allocated by system_info_get_platform_string() Change-Id: Ibccb1798db42ac207ecb5f9d95858919b40371c6 Signed-off-by: kibak.yoon --- diff --git a/test/peripheral-io-test.c b/test/peripheral-io-test.c index d8a103b..23b118d 100644 --- a/test/peripheral-io-test.c +++ b/test/peripheral-io-test.c @@ -16,6 +16,7 @@ */ #include +#include #include #include "peripheral_io.h" @@ -81,39 +82,41 @@ static int __test_peripheral_init() ret = __get_feature(KEY_FEATURE_PERIPHERAL_IO_GPIO, &feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; ret = test_peripheral_io_gpio_initialize(model_name, feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; ret = __get_feature(KEY_FEATURE_PERIPHERAL_IO_I2C, &feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; ret = test_peripheral_io_i2c_initialize(model_name, feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; ret = __get_feature(KEY_FEATURE_PERIPHERAL_IO_PWM, &feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; ret = test_peripheral_io_pwm_initialize(model_name, feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; ret = __get_feature(KEY_FEATURE_PERIPHERAL_IO_UART, &feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; ret = test_peripheral_io_uart_initialize(model_name, feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; ret = __get_feature(KEY_FEATURE_PERIPHERAL_IO_SPI, &feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; ret = test_peripheral_io_spi_initialize(model_name, feature); if (ret != PERIPHERAL_ERROR_NONE) - return ret; + goto ERR; +ERR: + free(model_name); return ret; } @@ -536,4 +539,4 @@ int main(int argc, char **argv) } return -1; -} \ No newline at end of file +}