|
43 | 43 | }
|
44 | 44 |
|
45 | 45 | pb_bytes_array_t *GDTCCTEncodeData(NSData *data) {
|
46 |
| - pb_bytes_array_t *pbBytes = calloc(PB_BYTES_ARRAY_T_ALLOCSIZE(data.length), 1); |
| 46 | + pb_bytes_array_t *pbBytes = calloc(1, PB_BYTES_ARRAY_T_ALLOCSIZE(data.length)); |
47 | 47 | if (pbBytes != NULL) {
|
48 | 48 | [data getBytes:pbBytes range:NSMakeRange(0, data.length)];
|
49 | 49 | pbBytes->size = (pb_size_t)data.length;
|
@@ -78,7 +78,7 @@ gdt_cct_BatchedLogRequest GDTCCTConstructBatchedLogRequest(
|
78 | 78 | NSDictionary<NSString *, NSSet<GDTCOREvent *> *> *logMappingIDToLogSet) {
|
79 | 79 | gdt_cct_BatchedLogRequest batchedLogRequest = gdt_cct_BatchedLogRequest_init_default;
|
80 | 80 | NSUInteger numberOfLogRequests = logMappingIDToLogSet.count;
|
81 |
| - gdt_cct_LogRequest *logRequests = calloc(sizeof(gdt_cct_LogRequest), numberOfLogRequests); |
| 81 | + gdt_cct_LogRequest *logRequests = calloc(numberOfLogRequests, sizeof(gdt_cct_LogRequest)); |
82 | 82 | if (logRequests == NULL) {
|
83 | 83 | return batchedLogRequest;
|
84 | 84 | }
|
@@ -111,7 +111,7 @@ gdt_cct_LogRequest GDTCCTConstructLogRequest(int32_t logSource,
|
111 | 111 | logRequest.has_log_source = 1;
|
112 | 112 | logRequest.client_info = GDTCCTConstructClientInfo();
|
113 | 113 | logRequest.has_client_info = 1;
|
114 |
| - logRequest.log_event = calloc(sizeof(gdt_cct_LogEvent), logSet.count); |
| 114 | + logRequest.log_event = calloc(logSet.count, sizeof(gdt_cct_LogEvent)); |
115 | 115 | if (logRequest.log_event == NULL) {
|
116 | 116 | return logRequest;
|
117 | 117 | }
|
|
0 commit comments