mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
chg: use calloc
This commit is contained in:
parent
e81b0fa355
commit
99b6087b01
7 changed files with 9 additions and 9 deletions
|
@ -75,7 +75,7 @@ const struct timeval timeout = {
|
|||
|
||||
serial_port uart_open(const char* pcPortName)
|
||||
{
|
||||
serial_port_unix* sp = malloc(sizeof(serial_port_unix));
|
||||
serial_port_unix* sp = calloc(sizeof(serial_port_unix), sizeof(uint8_t));
|
||||
if (sp == 0) return INVALID_SERIAL_PORT;
|
||||
|
||||
if (memcmp(pcPortName, "tcp:", 4) == 0) {
|
||||
|
|
|
@ -50,7 +50,7 @@ typedef struct {
|
|||
|
||||
serial_port uart_open(const char* pcPortName) {
|
||||
char acPortName[255];
|
||||
serial_port_windows* sp = malloc(sizeof(serial_port_windows));
|
||||
serial_port_windows* sp = calloc(sizeof(serial_port_windows), sizeof(uint8_t));
|
||||
|
||||
if (sp == 0) {
|
||||
printf("[!] UART failed to allocate memory\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue