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/gateway/dlt_gateway.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gateway/dlt_gateway.c') diff --git a/src/gateway/dlt_gateway.c b/src/gateway/dlt_gateway.c index 902822a..04237c2 100644 --- a/src/gateway/dlt_gateway.c +++ b/src/gateway/dlt_gateway.c @@ -425,8 +425,13 @@ int dlt_gateway_store_connection(DltGateway *gateway, gateway->connections[i].client.sock, DLT_DAEMON_RCVBUFSIZESOCK); /* setup DltClient Structure */ - gateway->connections[i].client.servIP = - strdup(gateway->connections[i].ip_address); + if(dlt_client_set_server_ip(&gateway->connections[i].client, + gateway->connections[i].ip_address) == -1) + { + dlt_log(LOG_ERR, + "dlt_client_set_server_ip() failed for gateway connection \n"); + return -1; + } if (ret != 0) { -- cgit v1.2.1