modules: remove redundant close

The close in the error path will never be called because the fd has been
stolen and will be -1.

Also make sure that when we free the source that we set it to NULL or
else the destroy function will try to free it again.
This commit is contained in:
Wim Taymans 2026-05-18 16:58:20 +02:00
parent 250260e18e
commit a6fe6196d5

View file

@ -550,8 +550,7 @@ int pw_rtsp_client_connect(struct pw_rtsp_client *client,
error: error:
if (client->source) if (client->source)
pw_loop_destroy_source(client->loop, client->source); pw_loop_destroy_source(client->loop, client->source);
if (fd >= 0) client->source = NULL;
close(fd);
return res; return res;
} }