Return accurate error codes for error cases.
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / camessagehandler.c
index 638610e..41b8884 100644 (file)
@@ -1111,7 +1111,7 @@ CAResult_t CADetachSendNetworkReqMessage(const CAEndpoint_t *endpoint,
     if (!cadata)
     {
         OIC_LOG(ERROR, TAG, "cadata memory allocation failed");
-        return CA_STATUS_FAILED;
+        return CA_MEMORY_ALLOC_FAILED;
     }
 
     CAEndpoint_t* ep = CACloneEndpoint(endpoint);
@@ -1119,7 +1119,7 @@ CAResult_t CADetachSendNetworkReqMessage(const CAEndpoint_t *endpoint,
     {
         OIC_LOG(ERROR, TAG, "endpoint clone failed");
         OICFree(cadata);
-        return CA_STATUS_FAILED;
+        return CA_MEMORY_ALLOC_FAILED;
     }
 
     cadata->remoteEndpoint = ep;