diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-02 16:34:39 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-02 16:34:39 +0200 |
commit | f146c3a3dcc43688e7e8d3eb6b7752567cf2dfc4 (patch) | |
tree | 37d5440a9f90b75ca569ddc4a53999cb1b17c026 /src | |
parent | 80fa4cb31216c9448334ac2efe83a488c3c97e35 (diff) |
broadband-modem: avoid segfault when initialization sequence is aborted
The ports context is only set if the initialization sequence succeeds; so don't
try to clear the ports context if it wasn't set.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-broadband-modem.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 1164e1be..06514c8f 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -7140,7 +7140,8 @@ initialize_context_complete_and_free (InitializeContext *ctx) g_simple_async_result_complete_in_idle (ctx->result); - if (MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->initialization_stopped && + if (ctx->ports_ctx && + MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->initialization_stopped && !MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->initialization_stopped (ctx->self, ctx->ports_ctx, &error)) { mm_warn ("Error when stopping the initialization sequence: %s", error->message); g_error_free (error); |