All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cinterion: Correct use of freed structure
@ 2015-05-13 16:08 Alex J Lennon
  2015-05-13 20:58 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Alex J Lennon @ 2015-05-13 16:08 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

On error struct cb_data *cbd was used after in cinterion_set_online
after already being freed.
---
 plugins/cinterion.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/cinterion.c b/plugins/cinterion.c
index 6d85189..a18b9fe 100644
--- a/plugins/cinterion.c
+++ b/plugins/cinterion.c
@@ -166,9 +166,9 @@ static void cinterion_set_online(struct ofono_modem *modem, ofono_bool_t online,
 	if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
 		return;
 
-	g_free(cbd);
-
 	CALLBACK_WITH_FAILURE(cb, cbd->data);
+
+	g_free(cbd);
 }
 
 static void cinterion_pre_sim(struct ofono_modem *modem)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cinterion: Correct use of freed structure
  2015-05-13 16:08 [PATCH] cinterion: Correct use of freed structure Alex J Lennon
@ 2015-05-13 20:58 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2015-05-13 20:58 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

Hi Alex,

On 05/13/2015 11:08 AM, Alex J Lennon wrote:
> On error struct cb_data *cbd was used after in cinterion_set_online
> after already being freed.
> ---
>   plugins/cinterion.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>

Applied, thanks.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-13 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 16:08 [PATCH] cinterion: Correct use of freed structure Alex J Lennon
2015-05-13 20:58 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.