pidgin/pidgin

Fix some issues scan-build found in util.c
release-2.x.y
2021-06-01, Gary Kramlich
de9b3386381b
Parents c00b451a1dd8
Children f25ce9376564
Fix some issues scan-build found in util.c

Testing Done:
Ran scanbuild and verified the bugs we fixed.

Reviewed at https://reviews.imfreedom.org/r/692/
--- a/libpurple/util.c Thu May 27 20:25:24 2021 -0500
+++ b/libpurple/util.c Tue Jun 01 16:51:13 2021 -0500
@@ -1479,6 +1479,7 @@
tag = tag->next;
}
if(tag) {
+ gpointer data;
while(tags) {
struct purple_parse_tag *pt = tags->data;
if(xhtml && !pt->ignore)
@@ -1500,8 +1501,9 @@
tags = g_list_remove(tags, pt);
g_free(pt);
}
- g_free(tag->data);
+ data = tag->data;
tags = g_list_remove(tags, tag->data);
+ g_free(data);
} else {
/* a closing tag we weren't expecting...
* we'll let it slide, if it's really a tag...if it's
@@ -3345,7 +3347,8 @@
hrs = secs / (60 * 60);
secs = secs % (60 * 60);
mins = secs / 60;
- secs = secs % 60;
+ /* this is no longer used, but in case you need it it's here.. */
+ /* secs = secs % 60; */
if (days > 0)
{