mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-07 16:48:15 +08:00
fix: mem leaks
This commit is contained in:
parent
de317d9f48
commit
00d1fd9d45
1 changed files with 4 additions and 0 deletions
|
@ -103,6 +103,8 @@ serial_port uart_open(const char* pcPortName)
|
|||
int s = getaddrinfo(addrstr, portstr, NULL, &addr);
|
||||
if (s != 0) {
|
||||
printf("Error: getaddrinfo: %s\n", gai_strerror(s));
|
||||
freeaddrinfo(addr);
|
||||
free(addrstr);
|
||||
return INVALID_SERIAL_PORT;
|
||||
}
|
||||
|
||||
|
@ -121,6 +123,8 @@ serial_port uart_open(const char* pcPortName)
|
|||
|
||||
if (rp == NULL) { /* No address succeeded */
|
||||
printf("Error: Could not connect\n");
|
||||
freeaddrinfo(addr);
|
||||
free(addrstr);
|
||||
return INVALID_SERIAL_PORT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue