diff options
author | Jens Georg <mail@jensge.org> | 2022-05-25 16:57:58 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2022-05-25 16:57:58 +0200 |
commit | b2fbaebb433dcf903f532580ad7dad9f8675bf00 (patch) | |
tree | 168367be7b26b6cccfa0052ff96aa73034804b68 /libgupnp | |
parent | 6d217227b9a0fa7836b1fa5639950af94c48617b (diff) | |
download | gupnp-b2fbaebb433dcf903f532580ad7dad9f8675bf00.tar.gz |
service: Prevent critical on notify error
The code did not handle the case nicelz where error wasn't "cancelled",
using a NULL pointer from the reason phrase.
Diffstat (limited to 'libgupnp')
-rw-r--r-- | libgupnp/gupnp-service.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c index 2c5f6ce..d515a87 100644 --- a/libgupnp/gupnp-service.c +++ b/libgupnp/gupnp-service.c @@ -1428,10 +1428,17 @@ notify_got_response (GObject *source, GAsyncResult *res, gpointer user_data) /* Emit 'notify-failed' signal */ GError *inner_error; - inner_error = g_error_new_literal ( - GUPNP_EVENTING_ERROR, - GUPNP_EVENTING_ERROR_NOTIFY_FAILED, - soup_message_get_reason_phrase (data->msg)); + // We have an error, so just propagate that + if (error != NULL) { + g_propagate_error (&inner_error, + g_steal_pointer (&error)); + } else { + inner_error = g_error_new_literal ( + GUPNP_EVENTING_ERROR, + GUPNP_EVENTING_ERROR_NOTIFY_FAILED, + soup_message_get_reason_phrase ( + data->msg)); + } g_signal_emit (data->data->service, signals[NOTIFY_FAILED], |