From 859802afd10d159b9e370058bca53c8c12bba2f5 Mon Sep 17 00:00:00 2001 From: Onkar Palkar Date: Thu, 2 Feb 2017 17:49:34 +0900 Subject: dlt-client: fix dlt_client_cleanup memory handling Setter function introduced for seting up string parameters which are free'd in dlt_client_cleanup Signed-off-by: Christoph Lipka --- src/console/dlt-control.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/console/dlt-control.c') diff --git a/src/console/dlt-control.c b/src/console/dlt-control.c index 8a66d0a..832343b 100644 --- a/src/console/dlt-control.c +++ b/src/console/dlt-control.c @@ -473,9 +473,12 @@ int main(int argc, char* argv[]) { for (index = optind; index < argc; index++) { - g_dltclient.servIP = argv[index]; + if(dlt_client_set_server_ip(&g_dltclient, argv[index]) == -1) + { + pr_error("set server ip didn't succeed\n"); + return -1; + } } - if (g_dltclient.servIP == 0) { /* no hostname selected, show usage and terminate */ @@ -489,9 +492,12 @@ int main(int argc, char* argv[]) { for (index = optind; index < argc; index++) { - g_dltclient.serialDevice = argv[index]; + if(dlt_client_set_serial_device(&g_dltclient, argv[index]) == -1) + { + pr_error("set serial device didn't succeed\n"); + return -1; + } } - if (g_dltclient.serialDevice == 0) { /* no serial device name selected, show usage and terminate */ -- cgit v1.2.1