Explorar el Código

Client: Fix a potential memleak if the client initialization fails

Julius Pfrommer hace 6 años
padre
commit
9834e57869
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/client/ua_client.c

+ 2 - 1
src/client/ua_client.c

@@ -161,7 +161,8 @@ UA_Client_secure_new(UA_ClientConfig config, UA_ByteString certificate,
                                                  remoteCertificate, trustList, trustListSize,
                                                  revocationList, revocationListSize,
                                                  securityPolicyFunction);
-    if(retval != UA_STATUSCODE_GOOD){
+    if(retval != UA_STATUSCODE_GOOD) {
+        UA_free(client);
         return NULL;
     }