Quellcode durchsuchen

replacing malloc with UA_malloc in subscription-related parts?

Stasik0 vor 9 Jahren
Ursprung
Commit
fd32ca887b
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      src/client/ua_client.c
  2. 1 1
      src/server/ua_subscription.c

+ 1 - 1
src/client/ua_client.c

@@ -966,7 +966,7 @@ UA_Boolean UA_Client_processPublishRx(UA_Client *client, UA_PublishResponse resp
             break;
     }
     if (tmpAck == NULL ){
-        tmpAck = (UA_Client_NotificationsAckNumber *) malloc(sizeof(UA_Client_NotificationsAckNumber));
+        tmpAck = (UA_Client_NotificationsAckNumber *) UA_malloc(sizeof(UA_Client_NotificationsAckNumber));
         tmpAck->subAck.sequenceNumber = msg.sequenceNumber;
         tmpAck->subAck.subscriptionId = sub->SubscriptionID;
         LIST_INSERT_HEAD(&(client->pendingNotificationsAcks), tmpAck, listEntry);

+ 1 - 1
src/server/ua_subscription.c

@@ -273,7 +273,7 @@ UA_StatusCode Subscription_createdUpdateJob(UA_Server *server, UA_Guid jobId, UA
         return UA_STATUSCODE_BADSERVERINDEXINVALID;
         
     UA_Job *theWork;
-    theWork = (UA_Job *) malloc(sizeof(UA_Job));
+    theWork = (UA_Job *) UA_malloc(sizeof(UA_Job));
     if(!theWork)
         return UA_STATUSCODE_BADOUTOFMEMORY;