bluez5: handle some allocation failures

This commit is contained in:
Wim Taymans 2026-05-04 14:27:34 +02:00
parent 6539c2bf8c
commit 057ae16504
2 changed files with 12 additions and 1 deletions

View file

@ -3505,6 +3505,10 @@ static DBusHandlerResult profile_new_connection(DBusConnection *conn, DBusMessag
rfcomm->profile = profile;
rfcomm->device = d;
rfcomm->path = strdup(path);
if (rfcomm->path == NULL) {
free(rfcomm);
return DBUS_HANDLER_RESULT_NEED_MEMORY;
}
rfcomm->source.func = rfcomm_event;
rfcomm->source.data = rfcomm;
rfcomm->source.fd = spa_steal_fd(fd);