Explorar el Código

fixing valgind warning

Stasik0 hace 9 años
padre
commit
b3321a132f
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  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';