aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-3gpp-ussd.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-08-06 21:58:22 +0200
committerDan Williams <dcbw@redhat.com>2018-08-21 16:50:15 +0000
commitfc41c167ce018ed1ec20c0969b6bd4536113d395 (patch)
tree7c471c0fa61bd270c58ba56eb3312f99133b33bd /src/mm-iface-modem-3gpp-ussd.c
parent4ef3623e6396d5e592410b0ce136a9acf559542d (diff)
iface-modem-3gpp,ussd: let send_finish() return a newly allocated string
GTask integration will benefit from this change.
Diffstat (limited to 'src/mm-iface-modem-3gpp-ussd.c')
-rw-r--r--src/mm-iface-modem-3gpp-ussd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mm-iface-modem-3gpp-ussd.c b/src/mm-iface-modem-3gpp-ussd.c
index 1da9459f..8fb3a413 100644
--- a/src/mm-iface-modem-3gpp-ussd.c
+++ b/src/mm-iface-modem-3gpp-ussd.c
@@ -194,15 +194,17 @@ handle_respond_ready (MMIfaceModem3gppUssd *self,
HandleRespondContext *ctx)
{
GError *error = NULL;
- const gchar *reply;
+ gchar *reply;
- reply = MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->send_finish (self, res,&error);
+ reply = MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->send_finish (self, res, &error);
if (!reply)
g_dbus_method_invocation_take_error (ctx->invocation, error);
- else
+ else {
mm_gdbus_modem3gpp_ussd_complete_respond (ctx->skeleton,
ctx->invocation,
reply);
+ g_free (reply);
+ }
handle_respond_context_free (ctx);
}
@@ -298,15 +300,17 @@ handle_initiate_ready (MMIfaceModem3gppUssd *self,
HandleInitiateContext *ctx)
{
GError *error = NULL;
- const gchar *reply;
+ gchar *reply;
reply = MM_IFACE_MODEM_3GPP_USSD_GET_INTERFACE (self)->send_finish (self, res, &error);
if (!reply)
g_dbus_method_invocation_take_error (ctx->invocation, error);
- else
+ else {
mm_gdbus_modem3gpp_ussd_complete_initiate (ctx->skeleton,
ctx->invocation,
reply);
+ g_free (reply);
+ }
handle_initiate_context_free (ctx);
}