Selaa lähdekoodia

replacing malloc with UA_malloc in subscription-related parts?

Stasik0 9 vuotta sitten
vanhempi
commit
fd32ca887b
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  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;