spa: bluez: backend-native: fix filtered number memory leak

The `number_filtered` variable was dynamically allocated but never freed.
This commit is contained in:
Barnabás Pőcze 2022-11-14 16:05:00 +01:00 committed by Wim Taymans
parent 93d2571b30
commit 14e044a92c
2 changed files with 15 additions and 25 deletions

View file

@ -1111,10 +1111,10 @@ next_indicator:
return true;
}
} else if (spa_strstartswith(buf, "ATD")) {
char number[31];
char number[31], sep;
enum cmee_error error;
if (sscanf(buf, "ATD%30s;", number) != 1) {
if (sscanf(buf, "ATD%30[^;]%c", number, &sep) != 2 || sep != ';') {
spa_log_debug(backend->log, "Failed to parse ATD: \"%s\"", buf);
rfcomm_send_error(rfcomm, CMEE_AG_FAILURE);
return true;