From: Ignacio Casal Quinteiro Date: Fri, 22 Nov 2019 11:32:13 +0000 (+0100) Subject: Fix clang static analysis warnings X-Git-Tag: v1.4~48 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bb48548a22c3f355b05a74618ff50c78f4a7963b;p=pidgin-chime.git Fix clang static analysis warnings Even though the code is ok better to deallocate the data after it is removing it from the list, to avoid the warning and to make the code clearer. --- diff --git a/chime/chime-call-audio.c b/chime/chime-call-audio.c index 52c7469..ee43da9 100644 --- a/chime/chime-call-audio.c +++ b/chime/chime-call-audio.c @@ -466,8 +466,8 @@ static gboolean audio_receive_data_msg(ChimeCallAudio *audio, gconstpointer pkt, if (m->msg_id >= audio->data_next_logical_msg) break; - free_msgbuf(m); audio->data_messages = g_slist_remove(audio->data_messages, m); + free_msgbuf(m); } } drop: diff --git a/prpl/messages.c b/prpl/messages.c index 44390c3..54899a9 100644 --- a/prpl/messages.c +++ b/prpl/messages.c @@ -99,8 +99,8 @@ void chime_complete_messages(ChimeConnection *cxn, struct chime_msgs *msgs) seen_one = TRUE; msgs->cb(cxn, msgs, node, ms->tm.tv_sec); } - g_free(ms); l = g_list_remove(l, ms); + g_free(ms); /* Last message, note down the received time */ if (!l && !msgs->msgs_failed && seen_one) {