pidgin/pidgin

Zero out some memory that scanbuild thought might be used
release-2.x.y
2021-06-03, Gary Kramlich
515660e0556d
Parents d235516f2d9c
Children d66ac2eb5e70
Zero out some memory that scanbuild thought might be used

Testing Done:
Verified that scanbuild no longer detected the errors.

Reviewed at https://reviews.imfreedom.org/r/716/
--- a/libpurple/desktopitem.c Thu Jun 03 19:36:49 2021 -0500
+++ b/libpurple/desktopitem.c Thu Jun 03 20:18:38 2021 -0500
@@ -340,7 +340,7 @@
get_encoding (FILE *df)
{
gboolean old_kde = FALSE;
- char buf [BUFSIZ];
+ char buf [BUFSIZ] = { 0 };
gboolean all_valid_utf8 = TRUE;
while (my_fgets (buf, sizeof (buf), df) != NULL) {
--- a/pidgin/gtksourceiter.c Thu Jun 03 19:36:49 2021 -0500
+++ b/pidgin/gtksourceiter.c Thu Jun 03 20:18:38 2021 -0500
@@ -513,7 +513,7 @@
string_list = g_slist_prepend (string_list, new_string);
}
- str_array = g_new (gchar*, n);
+ str_array = g_new0(gchar*, n);
i = n - 1;