summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-02-22 20:16:32 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-02-22 21:49:19 +0100
commitc19ee43cbea5c553b5ad2d5bb10f88abad574965 (patch)
tree26a6492072fa56a4655fc75df3336906d5d5d0a8
parent9976625f94335295843ff38440d9e48a6e899d3a (diff)
downloadModemManager-c19ee43cbea5c553b5ad2d5bb10f88abad574965.tar.gz
broadband-modem: avoid reading already freed memory in USSD operations
-rw-r--r--src/mm-broadband-modem.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index d1411e953..7f2ceb182 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -4187,10 +4187,10 @@ modem_3gpp_ussd_context_send_encoded (Modem3gppUssdSendContext *ctx)
&scheme,
&error);
if (!encoded) {
- g_simple_async_result_take_error (ctx->result, error);
- modem_3gpp_ussd_send_context_complete_and_free (ctx);
mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (ctx->self),
MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE);
+ g_simple_async_result_take_error (ctx->result, error);
+ modem_3gpp_ussd_send_context_complete_and_free (ctx);
return;
}
@@ -4247,14 +4247,13 @@ modem_3gpp_ussd_context_step (Modem3gppUssdSendContext *ctx)
{
if (ctx->encoded_used &&
ctx->unencoded_used) {
+ mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (ctx->self),
+ MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE);
g_simple_async_result_set_error (ctx->result,
MM_CORE_ERROR,
MM_CORE_ERROR_FAILED,
"Sending USSD command failed");
modem_3gpp_ussd_send_context_complete_and_free (ctx);
-
- mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (ctx->self),
- MM_MODEM_3GPP_USSD_SESSION_STATE_IDLE);
return;
}
@@ -4294,10 +4293,10 @@ modem_3gpp_ussd_send (MMIfaceModem3gppUssd *self,
user_data,
modem_3gpp_ussd_send);
- modem_3gpp_ussd_context_step (ctx);
-
mm_iface_modem_3gpp_ussd_update_state (MM_IFACE_MODEM_3GPP_USSD (self),
MM_MODEM_3GPP_USSD_SESSION_STATE_ACTIVE);
+
+ modem_3gpp_ussd_context_step (ctx);
}
/*****************************************************************************/