diff options
author | David Henningsson <david.henningsson@canonical.com> | 2011-09-12 11:23:57 +0200 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2011-09-14 09:23:38 +0100 |
commit | f0ad6fd413ecd620d63ae1a8c731f08bb1d3b5ca (patch) | |
tree | c9212d8ce5e33cf2f83b05c2b6f5fdbd9dc45626 /src | |
parent | aa3142ab208000fe675b1deba46461e7fe8e470f (diff) |
raop: Don't crash if fd is not open when trying to close it
BugLink: http://bugs.launchpad.net/bugs/845286
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/raop/module-raop-sink.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/raop/module-raop-sink.c b/src/modules/raop/module-raop-sink.c index 422f05c40..2cb7a95ea 100644 --- a/src/modules/raop/module-raop-sink.c +++ b/src/modules/raop/module-raop-sink.c @@ -235,10 +235,12 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse } case SINK_MESSAGE_RIP_SOCKET: { - pa_assert(u->fd >= 0); - - pa_close(u->fd); - u->fd = -1; + if (u->fd >= 0) { + pa_close(u->fd); + u->fd = -1; + } else + /* FIXME */ + pa_log("We should not get to this state. Cannot rip socket if not connected."); if (u->sink->thread_info.state == PA_SINK_SUSPENDED) { |