Browse Source

fixing valgind warning

Stasik0 9 years ago
parent
commit
b3321a132f
1 changed files with 1 additions and 0 deletions
  1. 1 0
      examples/networklayer_tcp.c

+ 1 - 0
examples/networklayer_tcp.c

@@ -453,6 +453,7 @@ static UA_StatusCode ClientNetworkLayerTCP_connect(const UA_String endpointUrl,
 
     //this is somewhat ugly, but atoi needs a c string
     char cstringEndpointUrl[endpointUrl.length+1];
+    memset(cstringEndpointUrl, 0, endpointUrl.length+1);
     memcpy(cstringEndpointUrl, endpointUrl.data, endpointUrl.length);
     cstringEndpointUrl[endpointUrl.length+1] = '0';