Skip to content

Commit

Permalink
replace some malloc with recorder_malloc
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Wang <[email protected]>
  • Loading branch information
wangvsa committed Jul 30, 2024
1 parent 73fd64c commit 7b9c6ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/recorder-cst-cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ char* compose_cs_key(Record* record, int* key_len) {
// Caller needs to free the record after use
Record* cs_to_record(CallSignature *cs) {

Record *record = malloc(sizeof(Record));
Record *record = recorder_malloc(sizeof(Record));
record->res = NULL; // we don't keep return value in Call Signature

char* key = cs->key;

Expand All @@ -107,7 +108,7 @@ Record* cs_to_record(CallSignature *cs) {
memcpy(&record->arg_count, key+pos, sizeof(record->arg_count));
pos += sizeof(record->arg_count);

record->args = malloc(sizeof(char*) * record->arg_count);
record->args = recorder_malloc(sizeof(char*) * record->arg_count);

int arg_strlen;
memcpy(&arg_strlen, key+pos, sizeof(int));
Expand Down

0 comments on commit 7b9c6ec

Please sign in to comment.