Skip to content

Commit

Permalink
Fixed malloc/free missmatch
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Oct 17, 2024
1 parent bff6b2c commit 60b4643
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/vscp/common/register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
else {
strValue = vscp_str_format("0x%04lx", val);
}
delete[] buf;
free(buf);
}
} break;

Expand All @@ -1758,7 +1758,7 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
else {
strValue = vscp_str_format("0x%04lx", val);
}
delete[] buf;
free(buf);
}
} break;

Expand All @@ -1780,7 +1780,7 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
else {
strValue = vscp_str_format("0x%llx", val);
}
delete[] buf;
free(buf);
}
} break;

Expand All @@ -1801,7 +1801,7 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
else {
strValue = vscp_str_format("0x%ullx", val);
}
delete[] buf;
free(buf);
}
} break;

Expand All @@ -1815,7 +1815,7 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
uint32_t n = VSCP_UINT32_SWAP_ON_LE(*((uint32_t *) buf));
float f = *((float *) ((uint8_t *) &n));
strValue = vscp_str_format("%f", *((float *) buf));
delete[] buf;
free(buf);
}
} break;

Expand All @@ -1830,7 +1830,7 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
double f = *((double *) ((uint8_t *) &n));
strValue = vscp_str_format("%g", *((double *) buf));

delete[] buf;
free(buf);
}
} break;

Expand All @@ -1843,7 +1843,7 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
}
strValue =
vscp_str_format("%02d-%02d-%02d", *((uint8_t *) buf), *((uint8_t *) (buf + 2)), *((uint8_t *) (buf + 4)));
delete[] buf;
free(buf);
}
} break;

Expand All @@ -1856,7 +1856,7 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
}
strValue =
vscp_str_format("%02d:%02d:%02d", *((uint8_t *) buf), *((uint8_t *) (buf + 2)), *((uint8_t *) (buf + 4)));
delete[] buf;
free(buf);
}
} break;

Expand Down

0 comments on commit 60b4643

Please sign in to comment.