fix: mem leak
This commit is contained in:
@@ -83,6 +83,7 @@ serial_port uart_open(const char* pcPortName) {
|
|||||||
|
|
||||||
if (addrstr == NULL) {
|
if (addrstr == NULL) {
|
||||||
printf("Error: strdup\n");
|
printf("Error: strdup\n");
|
||||||
|
free(sp);
|
||||||
return INVALID_SERIAL_PORT;
|
return INVALID_SERIAL_PORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user